TabBar pop-up menu

228 views Asked by At

I would like to know how to create the below menu when I click on a tabBarItem:

enter image description here

If I understood correctly I have to add function with frame on this function:

override func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) {
    if item.title == "Add" {
        print("add")
    }
}
1

There are 1 answers

0
OneCommentMan On

First you need to create the Second menu. Whether that’s programmatically or nib. It needs to be a UIViewController (assuming you’re using UIKit). Then on the did select trigger you can present the SecondMenu overFullScreen as a modal. I suggested a UIViewController as you can use apples existing navigation APIs todo the heavy lifting.

To get the illusion, make the SecondMenuController background clear and position the MenuContainerView as shown in your picture at the bottom.