The Decorator Pattern adds new features to objects without changing their core structure. Here’s what you need to know: What it does: Wraps objects with new behaviors How it works: Stacks multiple wrappers for more features Why it matters: Allows flexible, runtime changes without messy subclasses Key components: Component Interface Concrete Component Decorator Abstract Class […]
Foundation overloads the pattern matching operator ~= to enable matching against error codes in catch clauses. catch clauses in Swift support pattern matching, using the same patterns you’d use in a case clause inside a switch or in an if case … statement. For example, to handle a file-not-found error you might write: import Foundation […]
A question that comes back often when using Coordinator pattern in iOS development is how to pass data between views. Today I’ll share different approaches for a same solution, regardless if you are using MVVM, MVC or other architectural design pattern. As a reminder, Coordinator pattern is an architectural design pattern dedicated to handle navigation […]
Even though the iOS ecosystem is growing further every day from Objective-C, some companies still heavily rely on it. A week away for another wave of innovation from WWDC 2020, I thought it would be interesting to dive back into Objective-C starting with a MVVM pattern implementation. As a quick reminder, MVVM pattern is an […]
Introduced in 2019, Apple made UI implementation much simpler with With SwiftUI its UI declarative framework. After some time experiencing with it, I’m wondering today if MVVM is still the best pattern to use with. Let’s see what has changed, implementing MVVM with SwiftUI. Prerequisite Before starting, if you are not too familiar with MVVM […]