This week, let’s explore that topic, and take a look at a few different techniques that can be useful in order to avoid trading Massive View Controllers for Massive Views. No view controllers, no problems, right? However, while SwiftUI’s overall design does encourage us to write more composable, decoupled code by default - it still requires us to design and factor our view code in a way that doesn’t put too many responsibilities on individual types. Now, as we’re collectively moving towards SwiftUI as the go-to framework for building UIs for all of Apple’s platforms, it might first seem that this problem will simply go away. It’s so easy to end up with views that each represent an entire screen or feature - leading to code that’s often hard to change, refactor and reuse.įor UIKit-based apps (and to some extent AppKit-based ones, too), a very common manifestation of this problem is the “Massive View Controller” syndrome - which is when a view controller ends up taking on too many responsibilities, resulting in a massive implementation, both in terms of scope and line count. When writing any form of UI code, it can often be challenging to decide when and how to split various view implementations up into smaller pieces.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |