SwiftUI, MVVM, and Protocol-Oriented-Programming are a perfect match… when done correctly. Find out how.

Photo by Teer XC on Unsplash

One of the most commonly used iOS application architectures is MVVM: Model View View-Model.

As you’re no doubt aware, MVVM was proposed to combat the tendency towards “Massive” View Controllers when doing classic MVC (Model View Controller) development in UIKit. …

This is one design pattern you definitely don’t want to use. Here’s why.

Photo Adam Nieścioruk on Unsplash.

Design patterns come and go, and one of the fads currently ascendant in the iOS/Swift programming world is the concept of Immutable Objects.

To quote Wikipedia:

In object-oriented and functional programming, an immutable object is an object whose state cannot be modified after it is created.

Pretty straightforward. Immutable objects…

Bring a Kotlin like functional pattern to your Swift toolkit

Photo by Patrick Ward on Unsplash

We’ve all written code where we need some function to create and return a configured object.

func makeButton(_ title: String?) -> UIButton {
let button = UIButton()
button.translatesAutoresizingMaskIntoConstraints = false
button.titleLabel?.text = title
button.titleLabel?.font = .headline
button.setTitleColor(.red, for: .normal)
return button

The pattern is the same. Create a variable…

Jetpack Compose by Google

SwiftUI is a powerful tool, but Android’s version is better. Here’s why.

If you’re an Apple developer then there’s no doubt you’ve seen and heard all about SwiftUI, Apple’s new declarative framework for creating apps that run on iOS, iPadOS, macOS, watchOS, and tvOS.

But what you may not know is that Android also has a brand new declarative framework for creating…

Photo by Daniel Mingook Kim ~ Unsplash

It’s… complicated.

Don’t get me wrong. I’ve used quite a few languages in my career, and I wouldn’t want to go back to any of them. Swift in 2021 is modern, type-safe, highly-functional, and with new features like actors and async/await it keeps getting better and better.

I love Swift.

But… there…

It’s a powerful new feature in Swift 5.5… but you‘ll have to await for it...

With Actors and Async/Await, Apple has finally brought modern, asynchronous concurrency support to the Swift language. The syntax and concepts are powerful, clean, and elegant.

But Async/Await and Actors both suffer from a single, minor, almost insignificant issue… we can’t use them in our code.

I’ve written about this problem…

Apple.com iPad Pro Order Page

WWDC 21, iPadOS 15, the M1 chip, mismanaged expectations, and cancelled orders.

Apple announced iPadOS 15 during WWDC 21 and — to put it mildly — this wasn’t the iPadOS I was looking for.

Time to move along.

False expectations

To understand exactly what it was I was looking for, and why, we need to go back in time to Apple’s “Spring Loaded” event.

Photo by Adrià Tormo on Unsplash

A case for and against (mostly against) using classic DTO’s.

In a recent article, Using Data Transfer Objects (DTO) in Swift Code, Steven Curtis makes an argument for using DTO’s in Swift code as a standard practice. I disagree with that premise, and in this article I hope to demonstrate why.

Domain Models and Domain Transfer Objects

First, we need to define our terms. Here I’m…

Michael Long

I write about Apple, Swift, and technology. I’m a Lead iOS engineer at CRi Solutions, a leader in cutting edge mobile corporate and financial applications.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store