iOS Xcode 11 如何不使用storyboard
1.选中项目-->Generral-->Deployment-->Main Interface 设为空

image.png
2.删除Main.storyboard 文件--

image.png
3.删除info.plist下的Main.storyboard 描述(注意文件位置)

image.png
4.注意设置根视图的代码移动到了SceneDelegate.swift中了
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = (scene as? UIWindowScene) else { return }
window = UIWindow(frame: windowScene.coordinateSpace.bounds)
window?.windowScene = windowScene
window?.backgroundColor = UIColor.white
window?.makeKeyAndVisible()
window?.rootViewController = TabBarViewController()
}
本文标题:iOS Xcode 11 如何不使用storyboard
本文链接:https://www.haomeiwen.com/subject/sdelhhtx.html
网友评论