Michael Long
Aug 2, 2021

--

Without knowing more about what's in AppContext I can't comment on that. Having a single global state is kind of a bad idea, as I wrote in Deep Inside Views, State and Performance in SwiftUI.

You might also hunt down another one of my articles, Writing Testable Views in SwiftUI for some ideas. In fact, here's a link to most of my SwiftUI articles.

https://michaellong.medium.com/the-swiftui-series-abc180690a9d

Based on the above, I'm thinking about a future article on why most view models aren't needed in SwiftUI.

Stay tuned, and thanks for reading.

--

--

Michael Long
Michael Long

Written by Michael Long

I write about Apple, Swift, and SwiftUI in particular, and technology in general. I'm also a Lead iOS Engineer at InRhythm, a modern digital consulting firm.

Responses (1)