Swift: iOS Programmatic UI

Programming

Swift: iOS Programmatic UI

สร้าง iOS Project ด้วย UIKit แบบไม่ใช้ Storyboard

12 เดือนที่ผ่านมา

1 min read

Delete Storyboard

Delete item in Info.plist

Delete item in App info

Add Scene to App

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
    guard let windowScene = (scene as? UIWindowScene) else { return }
 
    let window = UIWindow(windowScene: windowScene)
    window.rootViewController = ViewController()
 
    self.window = window
    self.window?.makeKeyAndVisible()
}

Done.

Tags:

Swift iOS