Skip to content

Pushing ViewController from FlexLayout #251

Closed
@TeamRainless

Description

@TeamRainless

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions