One of the best years for Swift is close to reaching its end. Time flies when you’re having fun, and I can tell you that we’ve had enough reason to enjoy developing with Swift this year. Big releases like Xcode Cloud and the new Swift Concurrency changes have set the direction of developing apps in …
Reflection in Swift: How Mirror works
Reflection in Swift allows us to use the Mirror API to inspect and manipulate arbitrary values at runtime. Even though Swift puts a lot of emphasis on static typing, we can get the flexibility to gain more control over types than you might expect. I’ve been planning to explore the Mirror API for a long …
RunLoop.main vs DispatchQueue.main: The differences explained
RunLoop.main and DispatchQueue.main are often used as schedulers within Combine. During code reviews, I often encounter inconsistency in using one or another, which made me realize it’s not always clear what the differences are. You might be surprised by the outcome of this article! While you can use both RunLoop.main and DispatchQueue.main in different scenarios, …
Creating an App Update Notifier using Combine and async/await
An app update-notifier promotes a new app update to your users. Using a notifier will get better adoption rates with several benefits, like dropping old APIs and better conversion rates. In this article, I’ll demonstrate how to create your update-notifier without using any remote configuration. The latest update will be fetched based on your app’s …
Non-fatal errors vs fatal crashes: The differences explained
Non-fatal errors happen in every application that’s developed and have a close relationship with fatal errors. Most of us know that both types of errors have an essential difference: fatal errors are not recoverable, while non-fatals are. In my 10+ years of development experience, I’ve seen many engineers ignoring non-fatal errors since they wouldn’t crash …
Composition vs. Inheritance: code architecture solutions explained in Swift
Composition and inheritance are both fundamental programming techniques when working in object-oriented programming languages. You’ve likely been using both patterns in your code already, even though you might not know what they mean. Over the past ten years, I’ve often been using inheritance throughout my code. Although using inheritance often worked out fine, I’ve got …
Property Wrappers in Swift explained with code examples
Property Wrappers in Swift allow you to extract common logic in a distinct wrapper object. This new technique appeared at WWDC 2019 and first became available in Swift 5. It’s a neat addition to the Swift library that allows removing much boilerplate code, which we probably all have written in our projects. You can find …
Increasing development effectiveness by recognizing repetition
Development effectiveness determines how fast and efficient you can work as an engineer. The more efficient you can make your daily flow of development, the better your results will be. If you know me, you know that I love automating repetitive tasks. I’m able to keep up with SwiftLee, my newsletter, SwiftLee Jobs, and RocketSim …
Presentation tips for performing professional Swift talks
Presentation tips can help you perform professional Swift talks by making sure you’re well prepared and professional-looking. Last week, I gave a talk at SwiftLeeds, and I realized all my experience from 5 years of talks at multiple conferences and meetup talks was a bit lost. You might not know, but I initially started writing …
Nonisolated and isolated keywords: Understanding Actor isolation
SE-313 introduced the nonisolated and isolated keywords as part of adding actor isolation control. Actors are a new way of providing synchronization for shared mutable states with the new concurrency framework. If you’re new to actors in Swift, I encourage you to read my article Actors in Swift: how to use and prevent data races …