SwiftUI Weekly - Issue #181
The curated collection of links about SwiftUI. Delivered every Monday.
Reading
Trigger value pattern in SwiftUI
The recent version of the SwiftUI framework introduces a trigger value pattern across its APIs. Trigger value allows us to attach a view modifier that runs its action whenever the trigger value changes. You can find this pattern while using sensory feedback or launching keyframe animation in SwiftUI. This week, we will learn how to build custom view modifiers using trigger value pattern.
Removing the M from MVVM with SwiftUI
I get this question so often that I finally want to write about it. It won’t be a long post on iOS app architecture, and it won’t even be hot takes. It’s just how I ship iOS apps those days, especially Ice Cubes, my open-source SwiftUI Mastodon client. If you encapsulate your code well enough, your views are just a representation of states, nothing less, nothing more.
Identifiable protocol in SwiftUI explained with code examples
The Identifiable protocol in SwiftUI allows you to add a unique object identity. The protocol requires a single ID property of any hashable type, making it a flexible protocol for all kinds of instances.
Number Text Animation in SwiftUI with contentTransition
You have a text label that the number changes throughout some conditions. You want to animate that change and should be really smooth.
In Search of a Smooth Scroll
The search for smoother scrolling resulted in swapping LazyVGrid
for NSTableView
, documenting unofficial insights and reflections on AppKit coding.
Camera capture setup in a SwiftUI app
In this short tutorial you will learn how to set a camera feed capture in a SwiftUI app.
How to avoid using AnyView in SwiftUI
By using alternatives such as the @ViewBuilder attribute, Group type or generics.
Videos
MapKit with SwiftUI - Routes and Directions
In this video you will be shown how you can display a route between your current location and one of your selected placemarks. The route can be either by automobile or by walking. In addition, you will see how you can provide step by step directions.