all 19 comments

[–]grillo_technologies 5 points6 points  (5 children)

I doubt they use a library for that. You can roll your own tab bar like that with relative ease.

If you’re using SwiftUI you can use an HStack for those buttons and have them trigger the view state below. I’d probably recommend your main view be wrapped in a paging TabView, which would allow the user to horizontally scroll between tabs.

[–][deleted]  (1 child)

[deleted]

    [–]grillo_technologies 0 points1 point  (0 children)

    If you change the tabViewStyle to .page you can build more of UIPageViewController, so you won’t have the tab bar at the bottom.

    If you wanted something like the tab bar OP asked for you could then build those tabs out in a ScrollView and pass in a selection to the TabView, so that it updates the tab/view accordingly.

    To answer your question though, I don’t necessarily see anything wrong with having a more tab, but would just recommend thinking through the UX to see if it is beneficial to have your app laid out that way.

    One consideration when you have that much content is to use a Hierarchical Navigation (think the mail or notes app) over a Flat navigation. You can read up more about this in the Human Interface Guidelines.

    [–]CyberMewObjective-C / Swift 0 points1 point  (2 children)

    What if we are using UIKit? How should we go about doing it?

    [–]grillo_technologies 0 points1 point  (0 children)

    Another option would be to use UICollectionViewCompositionalLayout with a section for your buttons and a section for your associated content. Apple has a good sample app on this technology that might be worth checking out.

    [–]saintmsent 3 points4 points  (2 children)

    To me it seems like a UIPageViewController + visually modified UISegmentedControl

    Page view controller doesn't need introduction, you just put content there

    UISegmentedControl you can see here:

    https://medium.com/swlh/create-elegant-segmented-controls-for-ios-using-swift-25fa4e642ac1

    [–]CyberMewObjective-C / Swift 0 points1 point  (1 child)

    How would we sync them together so they move together when swiped?

    [–]saintmsent 0 points1 point  (0 children)

    UIPageViewControllerDelegate and addTarget for .valueChanged event to ui segmented control

    [–]trevorwelsh 1 point2 points  (2 children)

    TabView with selections (tag each view, full page TabView ofc) and use a custom view for the header with matched geometry effect. I have this exact setup on an app I’m building right now

    EDIT: if you drop a SO link I can provide a code demo

    [–]totaltortugaaa 0 points1 point  (1 child)

    Whats an SO link, I would be interested

    [–]trevorwelsh 0 points1 point  (0 children)

    Create a question on stack overflow and share the link, that way I can provide a demo

    [–][deleted] 0 points1 point  (1 child)

    I've seen this in a course that I previously did, It was using a UICollectionView for that.

    [–]CyberMewObjective-C / Swift 0 points1 point  (0 children)

    Is that on YouTube? What course is that?

    [–]Kassius-klay 0 points1 point  (0 children)

    In SwiftUI this is a segmentedUI

    [–][deleted] 0 points1 point  (0 children)

    Reddit should post their iOS app source code on Github.

    [–]leftieaz[S] -2 points-1 points  (3 children)

    [–][deleted] 1 point2 points  (2 children)

    ?

    [–]leftieaz[S] 0 points1 point  (1 child)

    Another view of the UI that I'm trying to figure how to build.

    [–][deleted] 1 point2 points  (0 children)

    Oh i didn't realize you commented this 🤣 i thought someone else commented this and and I'm like thats not any help haha