SwiftUI Weekly - Issue #34
The curated collection of links about SwiftUI. Delivered every Monday.
Reading
When does the order of SwiftUI modifiers matter, and why?
One of the major differences between SwiftUI and Apple’s previous UI frameworks is how views are configured. Rather than directly modifying various properties, we can instead apply modifiers to the views that we declare, which in turn assign the styles and behaviors that we’re looking to add.
Dependency Injection in SwiftUI
This post shows two ways of achieving dependency injection in SwiftUI: using @EnvironmentObject or a View Model Factory.
Coordinators in SwiftUI
Similar to Massive View Controllers, SwiftUI Views can grow exponentially & have way too much responsibility. Moving any functionality to a separate Layer is a welcoming choice.
Debugging SwiftUI: Trials and Tribulations
The stack trace isn’t of much help and no amount of view hierarchy tweaks got rid of it entirely. Initially I was under the impression that either my code or one of my external dependencies were doing something horribly wrong.
Handle Press And Release Events in SwiftUI
Learn how to detect and handle press and release events in SwiftUI, and how to create a custom modifier to simplify that task.
Presenting Popovers from SwiftUI
Is there a way to present UIKit popovers from toolbar buttons managed by SwiftUI?
Code
Construct
Dungeons & Dragons DM companion app in SwiftUI.
Video
Recreating the Breathe Animation - Part 1: Geometry and Colors
In this episode we'll be focusing on the geometry and the colors involved. I will be using PureSwiftUI but this project does not require it since we won't be using Layout Guides. I will add code call-outs whenever I use a PureSwiftUI extension so you can follow along without it if you so choose.
Recreating the Breathe Animation - Part 2: Animation and Ghosting
In this episode we'll be finishing things off by writing the code for the animations involved and the ghost petals! The animations are quite tricky for this one, but I think you'll agree that the extensions in PureSwiftUI can clean things up significantly especially when you have to rely on manual timings to control the sequencing.
Recreating Twitter's Interface
In this video, you will learn how to use Swift and SwiftUI to recreate Twitter's feed interface. We will be using a TabView to show each of the four tabs on Twitter, and we will create a custom TweetView to show tweets in a List.