SwiftUI Weekly - Issue #200
The curated collection of links about SwiftUI. Delivered every Monday.
Reading
Mastering container views in SwiftUI. Basics.
Since the very first version of the framework, SwiftUI has had several container views. The most popular ones are HStack, VStack, List, etc. This year, Apple introduced new APIs that allow us to build custom container views in a new way. This week, we will learn about the benefits of SwiftUI’s new decomposition APIs.
Phase Animator Behavior
I’m currently still busy researching all the animation APIs in SwiftUI. I’d like to understand them at such a level that I have either my own working implementation or know how to build it. With PhaseAnimator
, I always was a little confused as to how it actually works and why it sometimes seems to skip phases.
Insetting Scrollable Views’ Content With contentMargins In SwiftUI
SwiftUI simplifies the way we build user interfaces across Apple platforms. It provides a large set of tools to use, such as built-in views and view modifiers, with the contentMargins
modifier being among them. Introduced in iOS 17, it allows to inset content within scrollable views like ScrollView
, List
and TextEditor.
Introduction to Communication Patterns in SwiftUI
SwiftUI provides a powerful and declarative way to build UIs, allowing views to react to state changes automatically. However, managing communication between views, especially when passing data or events from one view to another, can be challenging if not handled properly. In this article, we’ll explore several communication patterns in SwiftUI that enable seamless data flow between views, ensuring that updates occur efficiently and in a way that aligns with SwiftUI’s architecture.
Using the zoom navigation transition in SwiftUI
The NavigationTransition
protocol allows developers to customize transitions between Views using the .navigationTransition(_:)
modifier. Beyond the typical left-to-right movement, a new zoom transition effect has been introduced that can be particularly useful for presenting UI items on a full screen.