Use bundle as a means to provide Mac APIs to Catalyst app.
In order to cross the @objc wall set by the Mac Bundle mechanism,
Swift structures cannot be used directly and must be bridged
through ObjC facades.
Create NSMenu in MVVM style and install it on app launch. Make
sure to do it in AppDelegate.applicationDidFinishLaunching(),
because doing it as early as in PassepartoutApp.init() would
crash Mac code.
Use .representedObject to own view models.
With menu in place, app can be sent to background when main window
is closed. Requires multiple documents support for app not to die
instantly.
Move all persisted state out of AppManager to where it really
belongs. To do that, inject a shared KeyValueStore object into
managers that need to persist part of their state in a strongly
typed manner.
Below are persisted states:
- PersistenceManager
- persistenceAuthor
- ProfileManager
- activeProfileId
- UpgradeManager (formerly AppManager)
- didMigrateToV2 (migrate former value)
- VPNManager
- tunnelLogFormat
- masksPrivateData
A similar approach is used for app-specific preferences, by using
a strongly typed enum (AppPreference) together with SwiftUI
@AppStorage property wrapper.
Worth moving logging logic into a specific LogManager.
Finally, drop any former view dependency on AppManager, as states
are now accessed through specific managers.
On configuration error, retain information about the profile that
triggered the error. For now, present an alert, but with this
information the UI can be easily changed later.
Finally? Basically Xcode build settings were referring to new
color name "AccentColor", while color set in repository was
still "accentColor".
Went unnoticed because Mac filesystem is case-insensitive, which
is why Git never committed the name change in the first place.
- Revert to more "stable" iPad idiom
- Set accent color the proper way
- Use .tint when available
- Unify navigation style by idiom
- Retain navigation bars in sidebar/detail
- Lighten sidebar appearance
- Fix Menu style (dropdown -> button)
- Use native Picker (dropdown)
- Use switch toggles rather than checkboxes
- Replace .actionSheet with .alert
- Increase minimum row height
CAVEAT: on Mac with iPad idiom, having a Section in .sidebar
produces artifacts. Header keeps changing height for no reason.
Retain Section on iPad multitasking only to not break navigation.