KYWheelTabController 2.0.0

KYWheelTabController 2.0.0

测试已测试
语言语言 SwiftSwift
许可证 MIT
发布最后发布Jan 2017
SPM支持 SPM

Maintained by kyo__hei.



KYWheelTabController

KYWheelTabController 是 UITabBarController 的子类。它使用圆形菜单代替 UITabBar。

sample.gif

安装

手动

只需将 Classes 文件夹添加到您的项目中。

使用方法

它可以使用与 UITabBarController 相同的方式使用。

  • tabBarItem.title 不支持。
  • tabBarItem.imageInsets 不支持。
  • tabBarItem.badgeValue 不支持。

代码

import UIKit
import KYWheelTabController

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

        let vc0 = UIViewController()
        vc0.tabBarItem = UITabBarItem(
            title: nil,
            image: UIImage(named: "sample0"),
            selectedImage: UIImage(named: "sample0_selected"))

        let vc1 = UIViewController()
        vc1.tabBarItem = UITabBarItem(
            title: nil,
            image: UIImage(named: "sample1"),
            selectedImage: UIImage(named: "sample1_selected"))

        let vc2 = UIViewController()
        vc2.tabBarItem = UITabBarItem(
            title: nil,
            image: UIImage(named: "sample2"),
            selectedImage: UIImage(named: "sample2_selected"))

        let vc3 = UIViewController()
        vc3.tabBarItem = UITabBarItem(
            title: nil,
            image: UIImage(named: "sample3"),
            selectedImage: UIImage(named: "sample3_selected"))

        let wheelTabController = KYWheelTabController()
        wheelTabController.viewControllers = [vc0, vc1, vc2, vc3]

        /* Customize
         // selected boardre color.
         wheelTabController.tintColor = UIColor.redColor()
        */

        window?.rootViewController = wheelTabController

        return true
    }

Storyboard

  1. KYWheelTabController 设置为 UITabBarController 的自定义类。

    sample2.gif

许可证

此代码遵守 MIT 许可协议