FlexLayout icon indicating copy to clipboard operation
FlexLayout copied to clipboard

Pushing ViewController from FlexLayout

Open TeamRainless opened this issue 1 year ago • 0 comments

I've tried a few different things... (like using Buttons instead of views) but I still haven't figured-out a reliable way to a push a viewcontroller from a FlexLout. I've figured out a workaround for PRESENTING another viewcontroller as a popup... But pushing using a navigation controller seems impossible:

https://stackoverflow.com/questions/78500667/swift-push-viewcontroller-from-flexlayout-view

You have to do something insane like this to present a popup:

func topMostController() -> UIViewController {
        var topController: UIViewController = UIApplication.shared.keyWindow!.rootViewController!
            while (topController.presentedViewController != nil) {
                topController = topController.presentedViewController!
            }
            return topController
        }

 @objc func didTapButton() {
        let topvc = topMostController()
        topvc.present(vc, animated: true, completion: nil)
       }

...but neither love nor money will push a viewcontroller.

TeamRainless avatar May 20 '24 10:05 TeamRainless