Latest 1.0.0
Homepage https://github.com/majinyu888/JYPageViewSwift
License MIT
Platforms ios 9.0, requires ARC
Authors

JYPageView_Swift

pages_Controller swift

How To Use

pod "JYPageViewSwift"

Code

let titles = [
        "测试分类01",
        "测试分类02",
        "测试分类03",
        "测试分类04",
        "测试分类05",
        "测试分类06",
        "测试分类07",
        "测试分类0000000000000000000000000000008"
    ]

    var childs = [UIViewController]()
    for _ in 0..<titles.count {
        let child = UIViewController()
        child.view.backgroundColor = UIColor.randomColor()
        childs.append(child)
    }

    let top_height = navigationController!.navigationBar.bounds.size.height + UIApplication.shared.statusBarFrame.size.height
    let rect = CGRect(x: view.frame.origin.x,
                      y: top_height,
                      width: UIScreen.main.bounds.size.width,
                      height: UIScreen.main.bounds.size.height - top_height)
    let style = JYPageTitleViewStyle()
    style.is_hidden_when_only_one_item = true

    let pageView = JYPageView(rect, style: style, titles: titles, parent: self, childs: childs)
    pageView.delegate = self
    view.addSubview(pageView)

extension UIColor {
    public static func randomColor() -> UIColor {
         let r = CGFloat(arc4random()%255)
         let g = CGFloat(arc4random()%255)
         let b = CGFloat(arc4random()%255)
         return UIColor(red: r/255.0, green: g/255.0, blue: b/255.0, alpha: 1.0)
     }
}

Latest podspec

{
    "name": "JYPageViewSwift",
    "version": "1.0.0",
    "summary": "JYPageViewSwift For Paged Controller",
    "description": "u4e00u4e2au7b80u5355u7684Controlleru7ba1u7406u5bb9u5668,u53efu4ee5u5de6u53f3u6ed1u52a8, JYPageViewSwift For Paged Controller",
    "homepage": "https://github.com/majinyu888/JYPageViewSwift",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "u9a6cu91d1u5b87": "[email protected]"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/majinyu888/JYPageViewSwift.git",
        "tag": "1.0.0"
    },
    "source_files": [
        "JYPageViewSwift",
        "JYPageViewSwift/JYPageViewSwift/JYPageView/*.{swift}"
    ],
    "requires_arc": true,
    "swift_version": "4.2"
}

Pin It on Pinterest

Share This