SwiftUI Disable Scroll in ScrollView or List
Reading time: 1 min
This recipe shows how to disable scrolling in a ScrollView or List, while still allowing interactions with its subviews.
Async Binding for SwiftUI
Reading time: 4 min
This recipe shows how to implement an async binding in SwiftUI. Just like a regular Binding, async binding creates a two-way connection between a property that stores data, and a view that displays and changes the data - except that those changes are expressed with async blocks.
Combine Async Map
Reading time: 1 min
This quick recipe shows how to implement a Combine map operator that takes an async
block. To do this, you need to:
- Use
Task
to run async code in a sync context. - Use the
Future
publisher to publish the new value theTask
is completed. - Use
flatMap
to transfer from your current publisher to theFuture
one.
Reading time: 1 min
This quick recipe shows how to write an extension for a Combine Publisher whose output is of a generic type.
SwiftUI Delay Action on Appear
Reading time: 1 min
This recipe shows how to perform delayed actions in SwiftUI. It also shows examples of how to implement a delayed onAppear for async and non-async blocks.