Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Pushing ViewController from FlexLayout #251

Open
TeamRainless opened this issue May 20, 2024 · 0 comments
Open

Pushing ViewController from FlexLayout #251

TeamRainless opened this issue May 20, 2024 · 0 comments

Comments

@TeamRainless
Copy link

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant