ylliX - Online Advertising Network

Decorator Pattern Explained: Basics to Advanced

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 […]

Pattern matching on error codes

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 […]

Introduction to MVVM pattern in Objective-C

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 […]