-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MBL-1453] PagedTabBar implementation and adding to PagedContainerViewController #2131
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I left a few comments, but overall I like it! I am quite concerned by the reliance on a badge number, though, since we're not going to get that on the user object for milestone 1. It might be worth confirming with Alison what we want this to look like for now before getting rid of it entirely, though. (I'm not actually sure if we'll want to show the count on the activity tab only - it'd be useful info but it'd look kinda weird.) If you do have an idea for how to get the badge number for the project alerts I'm happy to approve this pr as is; just let me know!
Kickstarter-iOS/Features/PledgedProjectsOverview/PPOContainerViewController.swift
Outdated
Show resolved
Hide resolved
Kickstarter-iOS/Assets.xcassets/colors/celebrate100.colorset/Contents.json
Outdated
Show resolved
Hide resolved
Generated by 🚫 Danger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!!
📲 What
Reimplements the paged tab bar look in SwiftUI, integrates it into Amy's existing PagedContainerViewController, and adds tests for it.
🛠 How
The
PagedTabBar
takes a list of instances ofTabBarPage
items, a basic protocol that has a name and badge count. It uses thePagedContainerViewModel
for determining which tab to show.The
PagedContainerViewModel
was cleaned up and had nearly all calls to index-based pages removed in favor of returning the TabBarPage instances. This should prevent worrying about over-indexing and risking runtime crashes.The new
PagedTabBar
has some screenshot tests and thePagedContainerViewModel
has had some unit tests added.Note: Originally there was a separate PagedTabBarViewModel that worked together with the PagedContainerViewModel, but this ended up being way too easy to accidentally end up with an infinitely recursive scenario where the PagedTabBarViewModel called the PagedContainerViewModel which called the PagedTabBarViewModel which called … [etc]. Since they are both relying on reactivity to update UI, for now they just use the same view model.
👀 See
Figma and the screenshot at the top of the screen
♿️ Accessibility
✅ Acceptance criteria
⏰ TODO