Latest 1.0.0
Homepage https://github.com/zhiquan911/CHSlideSwitchView
License MIT
Platforms ios 8.0
Dependencies SnapKit
Authors

CI Status
Version
License
Platform

Example


    var titles = [
        "推荐",
        "热点",
        "国际新闻",
        "段子",
        "国际新闻",
        "段子",
        "国际新闻",
        "段子",
        "国际新闻"
    ]

    override func viewDidLoad() {
    super.viewDidLoad()
        self.slideSwitchView.delegate = self
        self.slideSwitchView.headerView?.padding = UIEdgeInsets(top: 0, left: 10, bottom: 0, right: 10)
        self.slideSwitchView.headerView?.layout = .center
        self.slideSwitchView.headerView?.selectedStyle = .rectangle(cornerRadius: 13, height: 26, color: UIColor(white: 0.9, alpha: 1))
        //        self.slideSwitchView.headerView?.selectedStyle = .line(color: UIColor.red, height: 2.5)
        self.initTestVCDatas()

        self.slideSwitchView.slideItems = self.datas
    }

    // 初始化测试数据-ViewController
    func initTestVCDatas() {
        for (i, _) in self.titles.enumerated() {
            let item = CHSlideItem(key: i, title: titles[i], content: CHSlideItemType.viewController({ () -> UIViewController in
                let story = UIStoryboard.init(name: "Main", bundle: nil)
                let vc = story.instantiateViewController(withIdentifier: "DemoSelectViewController") as! DemoSelectViewController
                return vc
            }))
            self.datas.append(item)
        }
    }

Requirements

Installation

CHSlideSwitchView is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "CHSlideSwitchView"

Author

zhiquan911, [email protected]

License

CHSlideSwitchView is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "CHSlideSwitchView",
    "version": "1.0.0",
    "summary": "This a slideSwitchView for Swift 3.0.",
    "description": "u8fd9u662fu4e00u4e2aSwift3.0u7684u5f00u6e90u5e93uff0cu6ed1u52a8u6807u7b7eu7ec4u4ef6u5e93uff0cu50cfu300au7f51u6613u65b0u95fbu300buff0cu300au4ecau65e5u5934u6761u300bu7684u6807u7b7eu680fu3002",
    "homepage": "https://github.com/zhiquan911/CHSlideSwitchView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Chance": "[email protected]"
    },
    "source": {
        "git": "https://github.com/zhiquan911/CHSlideSwitchView.git",
        "tag": "1.0.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "CHSlideSwitchView/Classes/**/*",
    "dependencies": {
        "SnapKit": [
            "~> 3.2.0"
        ]
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This