SwiftUI Dependency Injection: From EnvironmentObject to Protocol DI
As your SwiftUI app grows, the phrase dependency injection alone can make your shoulders tense.
Read articleDESIGN · 70 ARTICLES
Continue through the latest Software design articles.
All articles
As your SwiftUI app grows, the phrase dependency injection alone can make your shoulders tense.
Read articleThe Interpreter Pattern always appears near the end of design pattern books. It is easy to skip because you wonder, “When would I ever use this?”
Read articleIn iOS development, you eventually need to keep adding operations to objects of many kinds, such as shapes or nodes.
Read articleHave you ever copied similar logic across classes and thought, “This feels wrong”? By the third copy of screen-specific data-loading code in an iOS app, your hands start to hesitate.
Read articleHave you ever hit a wall while adding an “Undo” button to an iOS app?
Read articleIf you've grown an iOS app beyond the basics, you've probably encountered this moment.
Read articleWhen building apps with Swift, you write loops like for item in array dozens of times a day. Because they feel so natural, you may only start wondering how they work after a custom type fails to compile in a for-in loop: "What is actually happening inside this loop?"
Read articleThe Facade pattern provides a single, simple entry point to a subsystem involving multiple objects. Using a Swift sign-up example, this article explains how to centralize call order and how Facade differs from Adapter, Proxy, and Decorator.
Read articleWhen building an iOS app with Swift, you may have wondered why this view controller receives an event after you tap a button.
Read articleThe previous modularization articles covered the principles of boundaries, dependency direction, and layer structure. Now it is time to apply them to an iOS project.
Read articleThe State Pattern groups state-specific behavior and transitions into objects or enums, reducing scattered conditionals. This article explains how to refactor Swift screen states and distinguish intentional designs that resemble the Strategy Pattern.
Read articleWhen building an app, you may need to create thousands or tens of thousands of similar objects. A typical example is placing tens of thousands of markers on a map, where the memory graph can easily keep climbing.
Read article