Category: Tutorial

  • #5 – Swifty CoreData (1/3)

    CoreData is an essential tool for iOS development. It is the primary persistence framework, necessary for persisting complex data types. It also sucks to work with. It was written way back in the Objective-C days and it shows. It doesn’t take advantage of many of the Swift features that we have come to know and…

  • #4 – Accessing environment variables in the view model

    One of the most powerful features of SwiftUI is the environment. Environment variables propagate downward, meaning that all subviews can access them as needed. What’s wonderful about this is that we don’t need to include them in our view initializers—they just work. There is a catch, though—only SwiftUI views can access environment variables. In the…

  • #3 – A script for boilerplate generation

    In previous posts, I have defined a “scene” in the context of my project as a module consisting of three files: a coordinator, a view, and a view model. As I develop my app, I plan on introducing several more scenes. However, it can be cumbersome to create three new files every time I need…

  • #2 – The SwiftUI coordinator

    Coordinators are primarily used for navigation, but another essential responsibility of the coordinator is dependency management. After all, to navigate to a new scene, you need to first ensure that all dependencies are provided. So let’s build on the previous post where we created a scene consisting of a coordinator, a view, and a view…

  • #1 – MVVM-C in SwiftUI

    MVVM is the most popular architecture for iOS development. I won’t delve into the reasons for its popularity, as there are numerous resources available on the topic. Historically, the coordinator pattern has paired well with MVVM and is very useful for separating navigation logic. However, with SwiftUI becoming increasingly common, several teams are shifting away…