feat: Supports quickly switching accounts with a swipe-up gesture on …
…the tab bar on iOS
Like I said on Mastodon, this is my first dabble in SwiftUI and Swift, so here be dragons (probably).
It implements switching the current account by simply swiping up on the tab bar. I'm open to suggestions.
It's working! Now I wonder why not a long tab to bring the account selector too?
It's working! Now I wonder why not a long tab to bring the account selector too?
I've removed the long tap. Should I re-add it?
I'm wondering if the swipe should swap the account or present the account selector sheet. I think maybe present the account selector sheet?
Maybe we could do both. The swipe is (or "feels") like a quick gesture, used for doing stuff swiftly, while the long press is for something more slower.
So maybe: long press for account selector sheet and swipe for switching the account?
Sound good to test
Could you please point me to the new code where you open the compose sheet in a tab? I'm not really sure how to trigger opening a sheet in SwiftUi.
Hmm it won't be easy as the app account selector is not globally available. I would need to refactor a few stuff. For now it's in AppAccountsSelectorView and there is no way to trigger it easily. It's bundled with the rounded avatar button basically.
Ah okay. Let me see, if I can manage the refactoring...
Done. I've also rebased and saw how you implemented the sheet of the New button. Maybe the accountsSelectorView can be implemented the same way, but please just take a look.
I'm testing it a bit, and I find that a tad confusing. Not sure this is the right direction :/
Yeah, I'm with you on that. The code needs to look more beautiful.
Yeah, I'm with you on that. The code needs to look more beautiful.
I was thinking about the UX, too. It's hard to discover. The TabView from SwiftUI is not really super extensible.
That's true, but I think the flick gesture to switch accounts is a nice UX, thought it has to be documented because, yes, it's not obvious. But in day-to-day usage it's pretty nice. I could live without the long-press gesture tbh.