Latest 0.4
Homepage https://github.com/ysCharles/TLPageView
License MIT
Platforms ios 9.0
Frameworks UIKit
Authors

GitHub license
Pods Versions
CI Status
Swift Version Compatibility
swiftyness
Swift Version
GitHub stars

Installation

Manually

  • clone this repo.
  • Simply drop the Sources folder into your project.
  • Enjoy!

Cocoapods

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

pod 'TLPageView'

Carthage

github "ysCharles/TLPageView"

Usage

import TLPageView

var colors : [UIColor] = [UIColor.yellow,UIColor.red,UIColor.brown,UIColor.blue]
    var titles : [String] = ["不仅仅是喜欢", "歌在飞", "小情歌", "回忆总想哭", "遥远的歌", "双节棍", "叶子", "天空中最亮的星", "稻香", "花桥流水"]
lazy var rightItem: UIButton = {
        let btn = UIButton(type: .custom)
        btn.frame = CGRect(x: 0, y: 0, width: 30, height: 44)
        btn .addTarget(self, action: #selector(btnClick), for: .touchUpInside)
        btn.setImage(UIImage(named: "More"), for: .normal)
        btn.setImage(UIImage(named: "More"), for: .highlighted)
        return btn
    }()

override func viewDidLoad() {
    super.viewDidLoad()
    var controllers = [UIViewController]()
        for i in 0..<10{
            let controller = UIViewController()
            controller.title = titles[i]//"测试中哈哈哈(i)"
            controller.view.backgroundColor = colors[i % 4]
            controllers.append(controller)
        }

        let pageView = TLPageView(viewControllers: controllers, pageViewOptions:[.menuHeight(50),.menuItemMargin(15), .rightItem(rightItem)])
        view.addSubview(pageView)
    pageView.frame = self.view.bounds
}

//
public enum TLPageViewOption {
    case menuHeight(CGFloat) // menuBar height

    case menuBottmonLineHeight(CGFloat) //bottom line height
    case menuBottomLineColor(UIColor)

    case menuItemFont(UIFont)
    case menuItemColor(UIColor)
    case menuItemSelectedColor(UIColor)
    case menuItemMargin(CGFloat)

    case leftItem(UIView)
    case rightItem(UIView)
}

License

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

Latest podspec

{
    "name": "TLPageView",
    "version": "0.4",
    "summary": "PageView, u5e26u5de6u53f3u5b9au5236 item",
    "homepage": "https://github.com/ysCharles/TLPageView",
    "license": "MIT",
    "authors": {
        "Charles": "[email protected]"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/ysCharles/TLPageView.git",
        "tag": "0.4"
    },
    "source_files": "Sources/**/*.swift",
    "frameworks": "UIKit",
    "swift_version": "4.1"
}

Pin It on Pinterest

Share This