Implement Undo with the Swift Command Pattern
When building an app, requests to “just add an undo button” come up more often than you might expect.
Read articleDESIGN · 70 ARTICLES
Continue through the latest Software design articles.
All articles
When building an app, requests to “just add an undo button” come up more often than you might expect.
Read articleSome bugs found just before release follow a familiar pattern. The frontend calculates a 10% discount while the backend uses 15%, or a field marked required in the documentation has disappeared from the actual API. Both codebases are fine. The problem is that the same information exists in two places…
Read articleWhen building an app with Swift, you eventually reach a point where classes keep multiplying.
Read articleWhen developing for iOS, you end up using lazy var very often.
Read articleWhen developing iOS apps, you sometimes want to add just logging or caching while keeping the core behavior intact. Start subclassing for that, and before long the inheritance tree becomes a mess.
Read articleA folder inside a folder, with more files inside. If you’ve handled this kind of tree structure in code, you’ve probably felt stuck at least once.
Read articleWe call Alamofire a library and SwiftUI a framework. But aren’t both just “using code written by someone else”? What’s the difference?
Read articleMost teams modularizing a project eventually create modules named Common, Core, or Utils.
Read articleIn the previous article, we summarized modularization as “grouping things that change together to establish boundaries.”
Read articleThe Prototype pattern reduces creation costs and duplicated setup by cloning existing objects. This article summarizes how Swift value-type copying differs from NSCopying in classes, and where shallow copying and Copy-on-Write come into play.
Read articleWhen building an app with Swift, your initialization code eventually starts looking like this.
Read articleAbstract Factory groups mutually compatible objects into product families and replaces them at once. Using a Swift theme example, this article explains how to prevent composition errors and choose between it and Factory Method.
Read article