Open S0ulf3re opened 2 years ago
The app implementation not consider this feature. I'm not sure how many people using multiple windows feature on iPad. And I think it's needs some efforts to make it.
Desperately wanting this feature, I ponied up the 99$ developer fee and compiled the app myself with "Supports Multiple Windows" Toggled to "YES". And surprisingly, with no changes to the code required, it seems to work in the Simulator. About to test it on my iPad, just gotta fix one little problem with app groups over in MastodonSDK
Ok, so I solved the problem (turns out I forgot to change the appGroup variable) and so far, mastodon is running very well on my iPad after compiling on the main branch with "Enable Multiple Windows" set to "YES".
Seeing as though that Mastodon is built with SceneDelegate, optimizing mastodon for Multiple Windows should be relatively easy.
Things that don't seem to work:
Browsing with multiple accounts This doesn't seem to work. If you switch accounts from the profile selector, it updates each and every window to where you last left off on the home tab. This is probably not a big deal, but should this feature ever see the light in the main App Store app (Which I really hope it does, since it's useful for bookmarking. Or especially useful for lists should they be added).
Reopen Closed Window
Within App Exposé in the app switcher (accessed by selecting the two squares icon by an app windows name), whenever a window is closed by swiping it upward, an option appears to "Reopen Closed Window" by the + button. When tapped however, this seems to terminate the entire app (and subsequently, all of its windows) causing them all to lose their position.
Although I haven't tested this, my hypothesis for other potential problems that would cause them to lose state would be background app terminations, as well as system restarts (similar to macOS).
Hi @S0ulf3re,
Sorry for the late reply. The first version of this app supports hot reloading the active user. But that may cause leaking. And the app actually reset the window to force reload the app now.
To makes the multiple windows work. We need to add an additional layer to handle the authentication info alongside the AppContext
. A good place the inject it is SceneCoordinator
. The coordinator could present the Onboarding scene when no authentication is available. And reset to normal app after user login. Then inject this into every ViewController & ViewModel.
I'm making some exploration on that project. A PR with that concept will be finished recently. But that needs a lot of work to refactor and migrate back to the Mastodon app.
It would be nice to have support for multiple windows on iPad. I know that Tweetbot supports this function and adding it would allow us to use multiple accounts with Mastodon at the same time. It could also be useful for moderators as well