pushViewController without navigationcontroller

前端 未结 5 1546
执念已碎
执念已碎 2020-12-31 06:54

I have a class that is of type UITableViewController. This class has a member of type UINavigationBar that I use for adding in an edit button for t

5条回答
  •  长发绾君心
    2020-12-31 07:18

    It's true that without a UINavigationController you can not push view controllers. You rather present view controllers modally via UIViewController.present(_ viewControllerToPresent:, animated:, completion:)

    But it's possible to create a custom segue to display the view controller as if it were a push (or any other animation you want), although it seems that using a UINavigationController just makes things easier.

    Here are some related links to the documentation:

    UINavigationController Class Reference

    Customizing the Transition Animations

    Presenting a Modal View Controller

提交回复
热议问题