Search code examples
iosswiftuipickerviewuitabbar

Make UIPickerView in front of Tab Bar


enter image description here

as you can see, my UIPickerView is in back a Tab bar, how to make it in front them? i'm using swift

and also my done button doesn't work to hide the UIView that contain UIPickerView, i'm sure the button connected to an action

here's my doneButton action

@IBAction func doneButtonTapped(sender: AnyObject) {

    self.viewUIPickerView.viewWithTag(1)?.hidden = true

}

Solution

  • When evere you try to open picker simply hide the tabbar like this

    self.tabBarController.tabBar.hidden = true
    

    onClick of done show the tabbar agian

    self.tabBarController.tabBar.hidden = false
    

    Hope this will help you.