测试已测试 | ✗ |
Lang语言 | SwiftSwift |
许可 | MIT |
发布最后发布 | 2017 年 8 月 |
SwiftSwift 版本 | 3.0 |
SPM支持 SPM | ✗ |
由 Jake Wagstaff 维护。
UITabBarController 的可自定义子类
要运行示例项目,请克隆仓库,然后首先从 Example 目录运行 pod install
要获取全部功能,请在您的 TabBarController 文件中导入 PutItOnMyTabBar
import PutItOnMyTabBar
简单地继承 'PutItOnMyTabBarController' 并覆盖必要的函数进行自定义!
class MyTabBarController: PutItOnMyTabBarController{
// MARK: Mandatory Functions Child Class must override
//Specifies how many tabs there are
override func numberOfTabs() -> Int{
return 3
}
//Gives TabBar all of the images it needs for when a tab is highlighted (in order of Tabs)
override func highLightedImages() -> [UIImage] {
return [image1, image2, image3]
}
//Gives TabBar all of the images it needs for when a tab is not selected (in order of Tabs)
override func unHighlightedImages() -> [UIImage] {
return [image1, image2, image3]
}
// MARK: Optional Overrides
// Gives Background to Tab Bar - Default is white
override func backgroundColor() -> UIColor{
return .white
}
// Optional Slider View that moves to selected Tab - Default is clear
override func sliderColor() -> UIColor {
return .clear
}
// Sets the height of a slider as a percentage of the total tab bar height - Default is 10%
override func sliderHeightMultiplier() -> CGFloat {
return 0.1
}
// Sets the sliders width as a percentage of each tab bars width - Default is 100%
override func sliderWidthMultiplier() -> CGFloat {
return 1.0
}
}
Jake Wagstaff – [email protected]
在 MIT 许可下分发。有关更多信息,请参阅 LICENSE