Possibly this could be categorized under MVC (MVVC?), but more likely under, That's Not How We Do It With Swift.
Problem Setup
I'm writing a custom Twitter client application; I've actually already done this in Java, and am using it as an opportunity to try applying what I'm learning in the Hacking with macOS book.
I've imported the Swifter framework to handle the Twitter API interactions.
Now, in my previous implementation, I had some objects that represented the API client, the user's saved credentials (so you don't have to log in every time you quit and relaunch the app), and the most recently fetched items on the timeline. Those sat out in a global space and the UI checked that global space for what to display.
The Question
I'm having a really hard time visualising how to structure this in a Swift project. All the examples I've worked through seem to embed the state right into the view classes, so there's not really one place to find all the state management. Further, there's the problem of deciding what to display: if you're not logged in, there's really nothing to show except a login button, but if you are logged in, then you should get a timeline window. Where should that logic reside? And should those be two distinct Views (I would assume so) or is it more Swifty to maybe use SwiftUI and just handle this in the var body: some View {...}
code block?