ive been working to integrate admobs to Xcode through the use of a tutorial online but ive noticed that when I open a new Xcode project there isn't a file called 'Appdelegate.swift' on the tutorial im watching the guy does have this file when he first opens it so im wondering how I can add it or what im doing wrong? many thanks George
how to get the app delegate file on Xcode
New Xcode projects default to using SwiftUI with the SwiftUI app life cycle. The SwiftUI app life cycle does not include an app delegate file. There are multiple ways to get an app delegate file.
The first way to get an app delegate is to choose Storyboard from the Interface menu when creating the project. Choosing Storyboard tells Xcode to use UIKIt for the project. UIKIt uses the app delegate file.
The second way applies only to Xcode 12. For iOS and Mac SwiftUI projects, there is a Life Cycle menu. Choose either UIKit App Delegate or AppKit App Delegate to get an app delegate file.
Xcode 13 does not have a Life Cycle menu. New projects use the SwiftUI app life cycle. To use the app delegate life cycle you will have to add a new file to the project for the app delegate and remove the App file that Xcode creates when building the project.
Xcode 13 does not have a Life Cycle menu. New projects use the SwiftUI app life cycle.
I just tested in Xcode 1313.0ß. I created a new project, selected Storyboard, Swift language. I do get AppDelegate and SceneDelegate files created automatically.
What you cannot do is have a SwiftUI project and select UIKit lifecycle. But that does not prevent to have a storyboard/UIKit project. Which is good news.