WWDC23 SALE: Save 50% on all my Swift books and bundles! >>

Hacking with Swift

SwiftUI by Example

SwiftUI by Example is the world's largest collection of SwiftUI examples, tips, and techniques giving you almost 600 pages of hands-on code to help you build apps, solve problems, and understand how SwiftUI really works.

Also available as a download edition


A brief explanation of the basics of SwiftUI

Building a complete project

Learn SwiftUI hands-on with a real app project

Working with static text

Laying out text neatly

Images, shapes, and media

Draw icons, circles, gradients, and more

View layout

Layout sizes, priorities, and spacing

Stacks, grids, scrollviews

Position views in a structured way

User interface controls

Respond to interaction and control your program state

Responding to events

Shortcuts, rotations, and appearance

Taps and gestures

Swipes, taps, shakes, and other input

Advanced state

Learn how to bind objects and query the environment


Create scrolling tables of data


Get user entry quickly and efficiently


Place your views inside a navigation controller and more


Direct your user through data in your app

Alerts and menus

Show modal notifications when something happens

Presenting views

Move your user from one view to another

Transforming views

Clip, size, scale, spin, and more


Take control of rendering using custom shapes


Bring your views to life with movement

Composing views

Make your UI structure easier to understand

Cross-platform SwiftUI

Learn to make your apps look great everywhere


Handle data with Core Data integration and more


How to make your apps usable by everyone


Build better apps with help from Xcode

What now?

How to continue learning SwiftUI after the basics

Appendix A

How to use each of SwiftUI's property wrappers

Appendix B

How to understand and fix common SwiftUI errors

Unknown user

You are not logged in

Log in or create account

Link copied to your pasteboard.