SwiftUI Weekly - Issue #204
The curated collection of links about SwiftUI. Delivered every Monday.
Reading
The power of previews in Xcode
Previews in Xcode become more powerful every year. Previews in Xcode are not about SwiftUI; you can use them even with UIKit. This week, we will talk about enhancing Previewable and PreviewModifier types, allowing us to build reusable preview environments.
Getting view size in SwiftUI without GeometryReader
Recently I needed to know size of SwiftUI container to layout horizontal carousel. The reason was to have one items always at least a tiny bit visible so users can reliably find the rest by scrolling. I started with GeometryReader and quickly got frustrated and started looking for another solution.
SwiftUI matched geometry effect in a custom segmented control
I'm working on a small macOS utility app and using it as an opportunity to experiment with some SwiftUI features. As part of this project, I decided to build a custom segmented control and looked for a simple, clean way to animate a capsule shape that highlights the selected option as it transitions between choices when the user interacts with the control. I found that using matchedGeometryEffect() was the most straightforward solution.
SwiftUI Zoom Navigation Transitions: Add a Touch of Magic to Your App
Since its introduction, SwiftUI has been a game-changer for building delightful, Apple-like user interfaces. And just when we thought it couldn’t get better, WWDC 2024 introduced a slew of new features, including one that’s been getting everyone buzzing—Zoom Navigation Transitions.
SwiftUI Charts Plotting Functions
In iOS 18 Apple added function plotting to the SwiftUI Charts framework.
Eight Fun SwiftUI Details in my Practice Planner
Here are eight little SwiftUI nuggets from the feature that I think turned out to be something worth sharing.