SwiftUI Weekly - Issue #67
The curated collection of links about SwiftUI. Delivered every Monday.
Reading
Mastering AsyncImage in SwiftUI
During our careers, we primarily build apps that work with web services to retrieve and upload data. Remote image is one type of that data that we need to download and display. SwiftUI provides us the AsyncImage type, which is a view that downloads and shows an image via URL. This week we learn how to use and customize AsyncImage in SwiftUI.
How to translate SwiftUI applications
Localizing our applications is more critical than we think. We usually stick with English as the primary language. Only 4.9% of the world’s 7.8 billion inhabitants speak English. Most of the people aren’t native English speakers. In the grand scheme of things, only 360 million people speak English as their first language.
Open Sourcing Identified Collections
Today we are open sourcing Identified Collections, a library of data structures for working with collections of identifiable elements in a performant way.
Observing ViewModel Changes in SwiftUI
SwiftUI uses declarative UI programming, where Views have immutable state, changing automatically as the data state depends on changes. This is a mindset change for most iOS/macOS developers: instead of changing the UI with a “command and control” MVC mindset, data state changes indirectly change the UI.
Cooperative Task Cancellation
Today, I want to focus on task cancellation. This is an important feature in Swift’s concurrency model that allows us to avoid unexpected behavior in our apps.
Searchable modifier in SwiftUI
SwiftUI finally got native search support in iOS 15. We can add search functionality to any navigation view with the new searchable modifier. Let's explore its capability and limitation.
Rewriting SpeakerClock in SwiftUI
After having delivered the watch app, I had a little extra time available to do something for myself. I do have some other ideas for apps, but my thoughts turned to SpeakerClock. I figured that this highly custom UI would lend itself nicely to be implemented in SwiftUI.
Swipe Actions in SwiftUI
Find out in this post how to use swipe actions in SwiftUI - actionable buttons to interact with when users swipe left or right on list rows.
Code
swift-identified-collections
A library of data structures for working with collections of identifiable elements in an ergonomic, performant way.
Video
Mastering Stacks in SwiftUI
In this SwiftUI tutorial, we’ll discuss and looking at stacks in SwiftUI. We’ll build a weather component that displays an hourly forecast of the upcoming weather readings, using a wide range of stacks whilst also answering many of the questions that you may have like, how to use HStack? How to use VStack? How to use LazyStack? What is a VStack in SwiftUI? What is a HStack in SwiftUI? And what is a LazyStack in SwiftUI?