SwiftUI: Choosing an Application Architecture
Again, we simply need to move as much logic as possible out of the view body and put it into variables and functions we can see from outside the view.
Because, and to paraphrase a military axiom: If we can see it, we can test it.
Because, and to paraphrase a military axiom: If we can see it, we can test it.
Michael Long • SwiftUI: Choosing an Application Architecture
Over the years we developed a few guidelines to help us out. Ideas like the single responsibility principle, the open-closed principle, the dependency inversion principle, and separation of concerns .