SwiftUI Weekly - Issue #73
The curated collection of links about SwiftUI. Delivered every Monday.
News
My favorite new Swift API from iOS 15
AsyncSequence and effectful read-only properties combine to make something beautiful.
Reading
Why Conditional View Modifiers are a Bad Idea
In the SwiftUI community, many people come up with their own version of a conditional view modifier. There are many blog posts out there with similar modifiers. I think all these blog posts should come with a huge warning sign. Why is the above code problematic?
Mastering FocusState property wrapper in SwiftUI
SwiftUI became very powerful during the last WWDC. We gained many new features, and one of them was a brand new FocusState property wrapper. FocusState property wrapper allows us to read and write the current focus position in the view hierarchy. This week we will learn how to manage focus in SwiftUI apps using FocusState property wrapper and focused view modifier.
Every SwiftUI Environment Value explained
A tour on the 50+ public environment values.
Defining dynamic colors in Swift
Various techniques let us define fully dynamic colors that adapt to the user’s selected color scheme, using either SwiftUI or UIKit.
@AppStorage explained and replicated for a better alternative
The @AppStorage property wrapper allows reading and writing user defaults easily, while monitoring changes to redraw SwiftUI Views.
How to store a Date using AppStorage in SwiftUI
By default, @AppStorage supports Int, String, Double, Data, or URL values. You can store other types if they conform to the RawRepresentable protocol.
Code
swift-custom-dump
A collection of tools for debugging, diffing, and testing your application's data structures.
Video
My SwiftUI Async/Await MVVM Project Structure
This SwiftUI 3.0 tutorial in Xcode 13 we will be looking at how I approach and structure my SwiftUI MVVM project specially with the new Swift async/await API available in Swift Concurrency. We’ll look at how we can structure a SwiftUI 3.0 project in Xcode 13 with networking capabilities. Well let’s jump into this SwiftUI 3.0 tutorial to see my thought process.
SwiftUI Environment Values - What are they?
In today's video, I explain what EnvironmentValues in SwiftUI are and how to use them. EnvironmentValues are a way for the device to communicate some of its system-wide settings with your SwiftUI app. In the code examples, I show you have to use a couple of these EnvironmentValues to adjust your UI to settings like Dark Mode and Dynamic Type.
SwiftUI Page View
In today's video I show you how to create a TabView with the Page style in SwiftUI. This results in views that you can swipe through with dots at the bottom indicating which screen you are on. This is typically found in onboard views.