Better Programming

Advice for programmers.

Follow publication

The Complete SwiftUI Documentation You’ve Been Waiting For

Go beyond Apple’s docs. Code examples, suggested best practices, and explanations of all the Views, controls, layouts, and more!

Millie Dev
Better Programming
Published in
46 min readFeb 11, 2020

--

This article is best viewed on Chrome due to limitations with linking to sections on Medium.

Photo by Susan Yin on Unsplash

Apple’s SwiftUI documentation covers a lot of the basics of SwiftUI. But what about those gaps that still exist? We all know that the documentation is likely to be updated massively when WWDC comes in June 2020, but we can’t wait that long!

Here is everything I’ve learned about every page of SwiftUI’s existing documentation. I won’t repeat what Apple has provided, but I’ll try to add what they don’t say. I’ll use the same categories for the sake of consistency, and definitely not because I’m too lazy to think of my own.

Each category title will link directly to Apple’s version.

I don’t expect anyone to read this entire post. If you do, I admire your dedication! I guess the Better Programming editors have to look it over, and I’m very grateful to them.

What I recommend is that although you may not need all of this now, you may need it in the future, so it would probably help to bookmark it and come back to it later when you have gaps in your knowledge.

I have gaps in my knowledge too, which is why I promise to update this post as often as I can. If there are areas you think I should clarify or cover in more detail, let me know!

Table of Contents

VIEWS AND CONTROLS
- SwiftUI 2 changes
- The View protocol
- Text
- Text ViewModifiers
- Standard text modifiers
- TextField
- TextField ViewModifiers
- SecureTextField
- SecureTextField ViewModifiers
- Font
- Image
- SF Symbols
- Button
- ButtonStyle
- NavigationView and NavigationLink
- EditButton
- MenuButton
- PasteButton
- Toggle
- Creating a custom ToggleStyle
- Picker
- DatePicker
- Slider
- Stepper
VIEW LAYOUT AND PRESENTATION
- HStack, VStack, and ZStack
- List, ScrollView, ForEach, and DynamicViewContent
- Identifiable
- Axis
- Form
- Group
- GroupBox
- Section
- Spacer
- Divider
- TabView
- VSplitView and HSplitView
- Alert

--

--

Millie Dev
Millie Dev

Written by Millie Dev

An iOS developer who writes about gadgets, startups and blockchains. Swift programming tutorials are at typesafely.co.Uk

Responses (12)

Write a response