Set the custom Tabbar and set actions to every tab iOS swift 3
If you want to create a custom tab bar with four buttons and add actions to the tab.Drag the tab bar to the viewController in the bottom side.Then add the tab bar items to the tab bar.first need to add the tab bar delegate to the ViewController.connect the delegate to the tab bar.
class ViewController: UIViewController,UITabBarDelegate{
}
func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) {
switch item.tag {
case 0:
//Put the action here
break
case 1:
//Put the action here
break
default:
break
}
}
Comments
Post a Comment