Hide tab bar in IOS swift app
You can simply use this in your ViewDidLoad()
method.
self.tabBarController?.tabBar.hidden = true
For Swift 3.0, 4.0, 5.0:
self.tabBarController?.tabBar.isHidden = true
Or you can change z position of tab bar this way:
self.tabBarController?.tabBar.layer.zPosition = -1
and if you want to show it again then:
self.tabBarController?.tabBar.layer.zPosition = 0
Remove TabBar item in Swift
You want to set the viewControllers
property of your tabBarController
with an array where you excluded the particular viewController that you don't want to have anymore.
if let tabBarController = self.tabBarController {
let indexToRemove = 3
if indexToRemove < tabBarController.viewControllers?.count {
var viewControllers = tabBarController.viewControllers
viewControllers?.remove(at: indexToRemove)
tabBarController.viewControllers = viewControllers
}
}
Disable tabbar item - Swift
Here is the answer
if let arrayOfTabBarItems = tabBarViewController.tabBar.items as! AnyObject as? NSArray,tabBarItem = arrayOfTabBarItems[2] as? UITabBarItem {
tabBarItem.enabled = false
}
Can't Remove Tab Bar After Deleting Tab Bar Item in Storyboard (Swift 4)
Please select: Bottom Bar - none
How to remove programmatically a tab bar item created in parent class NIB file?
The following code has the solution:
NSMutableArray *tbViewControllers = [NSMutableArray arrayWithArray:[self.tabBarController viewControllers]];
[tbViewControllers removeObjectAtIndex:2];
[self.tabBarController setViewControllers:tbViewControllers];
Hiding the tabbar and removing the space
If you're still seeing a black stripe under your hidden tab bar, have you tried to select Extend Edges Under Opaque Bars here?
Make also sure that Under Bottom Bars is still selected. Hope it helps!
Related Topics
How to Properly Send an Image to Cloudkit as Ckasset
Obtaining Bluetooth Le Scan Response Data with iOS
Undefined Symbols for Architecture Armv7 for Cocoapods Libraries
Does the List in Swiftui Reuse Cells Similar to Uitableview
iOS Uimenucontroller Uimenuitem, How to Determine Item Selected with Generic Selector Method
How to Get Index(Of:) to Return Multiple Indices
Duet - Merge 2 Videos Side by Side
Firebase Push Notifications Custom Sound
iOS - Another Thread Needs to Send Reloaddata to the Mainthread
Delphi/Firemonkey Change iOS Screen Rotation at Runtime
How to Implement Gmuclusterrenderer in Swift
Apns Push Notifications Not Working on Production
What Is Difference Between Self.Timer = Nil VS [Self.Timer Invalidate] in iOS
Using Wcsession with More Than One Viewcontroller