Swift: iOS Programmatic UI

Programming

Swift: iOS Programmatic UI

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

มากกว่า 1 ปีที่ผ่านมา

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