Michael Long
Sep 7, 2024

--

Nice. A couple of quibbles

.I'd question the use of ObservedObject, namely using UserViewModel in LoginView and ProfileView. Realize just a demo, but a view model, by definition, should usually be private to a given view. Passing them around should be a telltale flag that your view model is no such thing.

Using Combine for the stock publisher is fine, but in an article on performance I'd expect to see removeDuplicates in the stream to minimize UI updates.

Totally agree on view composition. That's SwiftUI's superpower.

--

--

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.

No responses yet