Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't my Swift app have AppDelegate or SceneDelegate?

So I'm new to Swift. I see it's a fast-moving language.

But so many tutorials I see have AppDelegate and SceneDelegate as standard init files, why don't I have any? Why can't I seem to find an option for them?

The tutorials include one from July 2020 so I'm guessing this is some sort of recent update. How should I approach the two types of apps with different file types? As a "Veteran" programmer, which is more advantageous?

Thanks everyone. Happy Coding.

like image 563
Maxime Franchot Avatar asked Nov 16 '20 22:11

Maxime Franchot


1 Answers

When creating a new iOS app, if you select SwiftUI App for the life cycle, this replaces the use of AppDelegate and SceneDelegate.

If you want a classic lifecycle delegate, you can select UIKit App Delegate instead.

Creating a Swift UI App

like image 188
Alexander Li Avatar answered Oct 16 '22 17:10

Alexander Li