SwiftUI Weekly - Issue #45
The curated collection of links about SwiftUI. Delivered every Monday.
Multiple variadic parameters, improved implicit member syntax, result builders, and more!
During the last year, I totally understand the power of a single source of truth and a state container that holds the whole app state in a single place. I’ve used this approach in a couple of my apps and continue to use it in new projects.
SwiftUI has lots of ways to create rounded rectangles but what if you want to match the corner radius of a widget? Apple added ContainerRelativeShape to iOS 14 for that purpose.
When building new SwiftUI components, it’s common to offer variants for different purposes/screens.
A look at what it means for SwiftUI to be a value-driven UI framework, and how we might need to break certain assumptions when adopting SwiftUI within our projects.
How event handling logic can be neatly encapsulated using private methods.
Bindings are also not set up to manipulate the timing or transform the data; and the operate on individual values – not streams of data or values over time. That is entirely by design. A core philosophy of the design of SwiftUI is having a single source of truth.
PermissionsSwiftUI displays and handles permissions in SwiftUI. It is largely inspired by SPPermissions. The UI/UX is highly customizable and resembles an Apple style.
We refactor our SwiftUI views to be testable in Previews without mocking the model.
Kilo Loco goes over a simple example of how to use MVVM (Model View ViewModel) with SwiftUI. He will cover strategies to keep code consistent, dependency injection of service models, and unit testing.