【发布时间】:2020-12-23 23:08:07
【问题描述】:
Xcode 中是否有一种方法(组合键、上下文菜单)可以从自定义 UIViewController(例如AViewController.swift)文件快速导航到情节提要中的屏幕,其中 AViewController.swift 在身份检查器选项卡?
【问题讨论】:
Xcode 中是否有一种方法(组合键、上下文菜单)可以从自定义 UIViewController(例如AViewController.swift)文件快速导航到情节提要中的屏幕,其中 AViewController.swift 在身份检查器选项卡?
【问题讨论】:
您需要在情节提要的身份检查器中设置情节提要 ID。然后推送:
let vc = storyBoard.instantiateViewController(withIdentifier: identifier)
vc.modalPresentationStyle = .fullScreen
self.navigationController?.pushViewController(vc, animated: true)
标识符是故事板ID
或者你可以用:
let vc = storyBoard.instantiateViewController(withIdentifier: identifier)
vc.modalPresentationStyle = .fullScreen
self.present(vc, animated: true)
【讨论】: