Create a segue and attach it between two view controllers through Swift?

前端 未结 1 1887
醉梦人生
醉梦人生 2021-01-25 09:06

How would we create a segue in swift programatically, without using Storyboards. I cannot use storyboards because of how the app is structured, so I need to know how to do it pr

相关标签:
1条回答
  • 2021-01-25 09:57

    Actually, you can only set segue identifier on storyboard. So if you want to navigate between two controllers, you should use

    func pushViewController(_ viewController: UIViewController, animated animated: Bool)

    or

    func presentViewController(_ viewControllerToPresent: UIViewController, animated flag: Bool, completion completion: (() -> Void)?)

    0 讨论(0)
提交回复
热议问题