Hideable UITabBar
Requirements
- iOS 11.0+
Installation
See the subsections below for details about the different installation methods.
CocoaPods
- Prepare project for CocoaPods usage by CocoaPods - Install / Get Started
- Add pod to project's profile
pod 'HideableUITabBar'
- LETS ROCK! or install pod
cd {PATH_TO_PROJECT}
pod install
Swift Package Manager
- Go to project
File
→Add Packages...
- Search for library, using URL:
https://github.com/dmytriigolovanov/hideable-uitabbar
- Set the
Dependency Rule
toUp to Next Major Version
Add Package
Using
Import library to needed swift file.
import HideableTabBar
Call setTabBarHidden(_:,animated:)
func to hide / show UITabBar.
let tabBarController = UITabBarController()
// hide tabbar
tabBarController.setTabBarHidden(true, animated: true)
// show tabbar
tabBarController.setTabBarHidden(false, animated: true)
Library provides ability to execute additional animation by subclassing UITabBarController
and override tabBarHideShowAdditionalAnimations(hidden:)
func.
RECOMMENDATION: This functionality can be used to animate additional UI elements, for exmaple such call button.
class TabBarController: UITabBarController {
override func tabBarHideShowAdditionalAnimations(hidden: Bool) {
super.tabBarHideShowAdditionalAnimations(hidden: hidden)
// additional animation
}
}
License
The contents of this repository are licensed under the MIT License.