DEV Community

Sagar Unagar
Sagar Unagar

Posted on

2 2

Basic structure of SwiftUI project

Apple introduced SwiftUI in WWDC 2019 that enabled a new way to create user-interface of your iOS app.

Whenever you create your single view app using SwiftUI, You will get the following basic template of your app.

Alt Text

SwiftUI default project structure

Let's discuss more about this all files,

AppDelegate.swift
After SwiftUI introduced, Appdelegate is only responsible for setting up external dependency and managing application data(ex. coredata).

SceneDelegate.swift
This is something new you can see in a project that is created using SwiftUI. SeceneDelegate is responsible for managing the way your app is shown. This contains the app transition methods that handle the app enter in the foreground, enter in the background, etc.

ContentView.swift
This is an initial view of your application. In this file, you can create your app interface using a declarative way. This is equivalent to ViewController that is being generated in the project that is created without using SwiftUI.

Assets.assets
As usual as previous, Assets contain all the images and colors that are used in our project.

LaunchScree.storyboard
This screen is displayed as a launch screen(splash screen) of your app. Nothing changes the way we setting up the launch screen previously.

Info.plist
This is a property list file that states all the system related settings like app name, app version, build number, etc.

Preview Contain
This folder includes one another asset catalog that is used at preview time in canvas.

Thanks for reading, Happy Holidays πŸŽ…πŸŽ„

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

Billboard image

πŸ“Š A side-by-side product comparison between Sentry and Crashlytics

A free guide pointing out the differences between Sentry and Crashlytics, that’s it. See which is best for your mobile crash reporting needs.

See Comparison

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay