Building a Multi-platform App with SwiftUI

The Introduction to SwiftUI session at WWDC 2020 included content that focused on using SwiftUI to build multi-platform apps - i.e apps that work on both iOS and macOS. Building such apps can be done by separately building for each platform from a single codebase, or creating a Mac Catalyst app which runs an app built for iPad on macOS. In this post, Rick Wierenga looks at the former, providing a tutorial that shows us how to use a single codebase to build a HackerNews app for each platform.

Dependency Injection via Property Wrappers

Property Wrappers in Swift allow us to add a layer of separation between code that manages how a property is stored and the code that defines a property. It's a powerful feature with a lot of potential use cases. Dependency injection is a software engineering technique used to supply dependencies to an object or value type. In this post, Kilo Loco demonstrates how we can use Swift property wrappers to pass dependencies to a SwiftUI view. It's a cool idea.

SwiftUI Hierarchy List

New in iOS 14 is the ability to easily create hierarchical lists using SwiftUI's List view type. Given a recursive data model that contains optional children of the same type as the parent, a List will display a tree-like structure with expandable rows. In this post, Federico Zanetello shows us how to implement our version of a hierarchical list, creating a custom type that is compatible with iOS 13. I like the approach Federico takes in his posts. Implementing our version of existing types and APIs is a great way of learning more about how the original versions work.