SwiftUI Weekly - Issue #45
The curated collection of links about SwiftUI. Delivered every Monday.
What’s new in Swift 5.4?
Multiple variadic parameters, improved implicit member syntax, result builders, and more!
Redux-like state container in SwiftUI. Connectors
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 Container Relative Shape
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.
Custom SwiftUI view styles
When building new SwiftUI components, it’s common to offer variants for different purposes/screens.
The lifecycle and semantics of a SwiftUI view
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.
Passing methods as SwiftUI view actions
How event handling logic can be neatly encapsulated using private methods.
Integrating SwiftUI Bindings and Combine
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.
Designing with Previews
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.