Bird
0
0

After creating a new iOS project with SwiftUI selected, what file will contain the app's main entry point?

medium📝 Predict Output Q4 of 15
iOS Swift - iOS Basics and Setup
After creating a new iOS project with SwiftUI selected, what file will contain the app's main entry point?
AYourAppNameApp.swift
BAppDelegate.swift
CContentView.swift
DSceneDelegate.swift
Step-by-Step Solution
Solution:
  1. Step 1: Understand SwiftUI app structure

    SwiftUI uses a file named YourAppNameApp.swift as the main entry point with @main attribute.
  2. Step 2: Differentiate from UIKit files

    AppDelegate.swift and SceneDelegate.swift are used in UIKit projects, not SwiftUI by default.
  3. Final Answer:

    The main entry point is YourAppNameApp.swift. -> Option A
  4. Quick Check:

    SwiftUI main file = YourAppNameApp.swift [OK]
Quick Trick: SwiftUI apps start in YourAppNameApp.swift file [OK]
Common Mistakes:
  • Choosing ContentView.swift which is UI only
  • Confusing UIKit delegate files with SwiftUI

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More iOS Swift Quizzes