How to set up your SwiftUI Project with AppDelegate and SceneDelegate

Create SwiftUI Project

Create SwiftUI Project
Your Created Project

Implement AppDelegate

AppDelegate
AppDelegate.swift
Your App
Test Code

Implement SceneDelegate

Create SceneDelegate.swift
SceneDelegate.swift
Connect SceneDelegate.swift in AppDelegate.swift
AppDelegate.swift
Scene Delegate

Conclusion

  1. Create AppDelegate.swift
  2. Add Boilerplate Code
  3. Attach it on App with @UIApplicationDelegateAdaptor
  1. Create SceneDelegate.swift
  2. Add Boilerplate Code
  3. Connect it through func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
KD Knowledge Diet

KD Knowledge Diet

Software Engineer, Mobile Developer living in Seoul. I hate people using difficult words. Why not using simple words? Keep It Simple Stupid!