Photo by Daniel Mingook Kim ~ Unsplash

I Hate Swift. I Love Swift.

It’s… complicated.

Michael Long
Published in
7 min readJul 28, 2021

--

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 are days.

Resolver

The impetus for this story resolves around an article written by Antoine van der Lee, titled Dependency Injection in Swift using latest Swift features.

Now, as the author and lead architect of the open-source Swift dependency injection framework Resolver, I’m always interested in how people attempt to solve the same exact problems I faced when I created that project.

In particular, Antoine was trying to solve one of the common problems with container-based dependency injection systems, in that often you don’t discover a missing dependency until you run the app and it crashes.

While that can sound like a major issue, in reality a missing registration is usually readily apparent the first time you run the code. And with developer testing, unit testing, quality-assurance testing… well, let’s just say I’ve never had a missing dependency slip by, and my team has been using Resolver in production…

--

--

Michael Long

I write about Apple, Swift, and SwiftUI in particular, and technology in general. I'm also a Lead iOS Engineer at InRhythm, a modern digital consulting firm.