What is SwiftUI?
SwiftUI is a user interface toolkit that allows developers to design iOS apps declaratively. With SwiftUI, developers determine what they’d like their user interface to look like and how it should function, and SwiftUI makes it happen as users interact with it. Declarative Swift syntax is easy for developers to read and natural to write. It also acts as a cross-platform user interface layer for iOS, macOS, tvOS, and watchOS — meaning you only have to learn one language and one layout framework to deploy your code anywhere. SwiftUI also works seamlessly with new Xcode design tools to keep your code and design working in lockstep.
While SwiftUI is beginner-friendly, it's also packed with design and workflow tricks to help streamline the development of top-quality user interfaces and interactions. There are additional aids to help you throughout your development journey, too. By leveraging APIs and SDKs, you can bypass complex builds for elements of your app, like chat messaging.
To make the most of the toolkit, we’ve rounded up 24 of the top SwiftUI tutorials to cover the basics, plus a bit more.
Basic Components of SwiftUI
Views and Controls
Views and controls are the visual building blocks of your iOS app’s user interface. Use them to present your app’s content on the screen and support user interactions. Views represent text, images, shapes, and custom drawings and animations, while controls enable user interaction with consistent APIs that adapt to their platform and context. Developers can combine views to create stacks. They can also dynamically generate groups and lists of views, define view presentations, and embed AppKit, UIKit, and WatchKit views and controllers into SwiftUI view hierarchies.
Data and Events
As previously mentioned, SwiftUI takes a declarative approach to managing data. As you compose a view hierarchy, you also establish data dependencies for the views. When an external event or user interaction occurs, SwiftUI automatically updates the affected parts of the interface. As a result, the framework automatically performs most of the work traditionally done by view controllers and helps you maintain a single source of truth for every piece of data in your app.
SwiftUI Essentials from Apple
The best way to familiarize yourself with the essentials of SwiftUI is by going straight to the source. Apple’s introductory course is four chapters long and covers:
SwiftUI Essentials: Learn how to use SwiftUI to handle user input, compose rich views out of simple ones, set up data flow, and build out navigation infrastructure while watching it unfold in Xcode’s preview.
Drawing and Animation: Learn how to draw shapes and paths to create a badge that you’ll animate and create seamless transitions.
App Design and Layout: Learn how to work with UI controls and manage the structure and layout of more complex interfaces.
Framework Integration: Learn how to use SwiftUI views and view controllers from platform-specific UI frameworks and test your skills by creating a macOS or watchOS app.
Top SwiftUI Resources
SwiftUI Tutorials from Apple
- Creating and Combining Views — Build your own Landmarks using stacks to combine and layer image and text components.
- Working with UI Controls — Learn how to give your app users control over their profiles by working with common data entry controls.
- Handling User Input — Practice building a list that your app users can interact with and narrow it down to just their favorites.
- Building Lists and Navigation — Leverage Xcode to create dynamic lists that app users can scroll through.
- Drawing Paths and Shapes — Practice combining paths and shapes to create badges for your app users.
- Animating Views and Transitions — Learn how to animate views within Landmarks.
- Add Rich Graphics to Your SwiftUI App — Familiarize yourself with safe areas while designing edge-to-edge graphics and experimenting with vibrancy, materials, backgrounds, and controls.
- Composing Complex Interfaces — Learn how to shift the orientation of your lists and the way users can scroll through them.
- Interfacing with UIKit — Practice interacting with the existing UI frameworks Apple provides.
Video Tutorials
- SwiftUI Basics for Beginners — Learn the basics of this SwiftUI Framework by moving step-by-step through the development of a demo project.
- SwiftUI Live: Building an App from Scratch — Build your very own SwiftUI app from scratch with this live tutorial.
Additional Resources
- UI Kit vs. SwiftUI — Learn how to decide between SwiftUI and UIKit for your next iOS Xcode project.
- 100 Days of SwiftUI by Paul Hudson — Peruse this free collection of videos, tutorials, tests, and more to help you learn SwiftUI effectively.
- Ultimate SwiftUI Cheat Sheet on Github — The beginner’s cheat sheet to everything SwiftUI to help you script the basics of your app.
- SwiftOnTap – Complete SwiftUI Docs with Examples — SwiftUI documentation to fill the gaps within Apple’s resources.
- SwiftUI Examples for Designers — Everything you need to know to design a visually stunning SwiftUI app.
- SwiftUI Tutorials — A complete list of text-based tutorials for SwiftUI.
- Build a Chat App with SwiftUI — Learn about Stream’s SwiftUI SDK by building an iOS chat app that is fully functional and customizable.
SwiftUI Newsletters — Stay Up to Date!
- SwiftUI Weekly — Sign up to have a curated collection of links about SwiftUI delivered to your inbox every Monday, plus gain access to content from past emails.
- Hacking with Swift — Register for a Swift newsletter that delivers news, tutorials, discounts, and more to your inbox for free.
- iOS Goodies — A recently retired newsletter that has published all of its past email content on this page for you to enjoy.
SwiftUI Forums — Need More Help?
- SwiftUI Reddit — An online community forum for SwiftUI users to ask questions, provide suggestions, and discuss the framework.
- SwiftUI Apple Developer Forum — Apple's developer forum for SwiftUI where users can ask for help troubleshooting certain aspects of the framework.
- StackOverflow — A forum where users can ask questions and receive answers from other SwiftUI enthusiasts.
Start Developing Your App with SwiftUI
Now that you know the basic components of SwiftUI and have the resources you need to get started, it’s time to begin developing your first SwiftUI app! In addition to the Apple tutorials, we’ve listed 24 supplemental videos, cheat sheets, and websites above that contain all of the information you’ll need during your development process and ways to stay connected to industry news long after.
Top comments (2)
This is a great article. I really thank you for putting this information together and posting.
I'm so glad you found it useful, David! Thanks for reading!