Introduction
Knowing the project structure helps you find and organize your app files easily.
Knowing the project structure helps you find and organize your app files easily.
MyAppProject/ ├── AppDelegate.swift ├── SceneDelegate.swift ├── Assets.xcassets ├── Base.lproj/ │ └── LaunchScreen.storyboard ├── Info.plist ├── ViewController.swift └── Main.storyboard
AppDelegate.swift manages app life cycle events.
Assets.xcassets holds images and icons.
MyAppProject/ ├── AppDelegate.swift ├── ViewController.swift └── Main.storyboard
MyAppProject/ ├── Assets.xcassets ├── Info.plist ├── Base.lproj/ │ └── LaunchScreen.storyboard └── Supporting Files/
This simple app has an AppDelegate that prints a message when the app starts. The ViewController shows a blue screen.
import UIKit @main class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { print("App started") return true } } class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .systemBlue } }
The Info.plist file stores app settings like name and version.
Storyboards define the app screens visually.
Keep your files organized to avoid confusion as your app grows.
iOS projects have a clear folder and file structure.
AppDelegate and SceneDelegate manage app life cycle.
Assets and storyboards hold images and UI layouts.
let window = UIWindow(frame: UIScreen.main.bounds) window.rootViewController = UIViewController() window.makeKeyAndVisible()What is the purpose of this code in the project structure?
Pass the test and this pattern moves unknown