Latest Updates
Read my latest articles. Browse the archives. Follow the RSS feed. Subscribe to the newsletter to get the latest posts direct to your inbox.
-
Widget Background and Accent Color
When you create a new Widget you may have noticed that it gets its own asset catalog. As well as the usual
AccentColor
this also contains aWidgetBackground
color. What are these for and how are you supposed to use them? -
SwiftUI Custom View Modifiers
Create your own custom SwiftUI view modifier when you want to reuse a set of modifiers on multiple views. Removing duplication also cleans up and improves the readability of your SwiftUI views.
-
Using Swift Result and flatMap
The Swift
Result
type is handy way to capture the results of a throwing expression that you need to execute on a background thread. UseflatMap
to chain several results together. -
Swift If Case Let
The Swift If-Case-Let syntax is a convenient shortcut to avoid a full switch statement when you only want to match a single case. The syntax always seems backwards to me so here’s a reminder of how to use it.
-
Creating dynamic dark mode images at runtime
If you’re creating your images from the asset catalog you support dark mode by adding light and dark variations of the image. How about when you’re creating the images at runtime? How about when you’re using SwiftUI?