SimpleTabBarAnimations
以简单的方式为您的标签栏添加动画。
需求
- iOS 12.0+
- Swift 5
安装
SimpleTabBarAnimations 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中
pod 'SimpleTabBarAnimations'
使用示例
- 请确保您已为标签栏设置了一个着色色。
tabBar.barTintColor = .white
- 导入SimpleTabBarAnimation并将其UITabBarController适配到它。
import SimpleTabBarAnimation
- 重写func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) 并在其中使用提供的功能。
extension TabBarVC: SimpleTabBarAnimation {
override func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) {
playAnimation(type: .bounce, for: item)
}
}
许可协议
SimpleTabBarAnimations 在MIT许可下提供。有关更多信息,请参阅许可证文件。