Latest 0.1.0
Homepage https://github.com/nullLuli/FlexPageView
License MIT
Platforms ios 9.0
Authors

Screenshot Preview

Features

  • 仿UITableView,翻页操作同业务分离,使用代理的方式获取数据和UI
  • 支持定制标签栏UI
  • 支持翻页的视差效果
  • 支持预加载、缓存

Installation

pod 'FlexPageView'

Usage

//1. 生成一个FlexPageView,并添加到view层级中
var option = FlexPageViewOption()
option.selectedColor = UIColor.red //option中定制UI
let layout = MenuViewLayout() //可以是自己的自定义的layout
let pageView = FlexPageView(option: option, layout: layout)
pageView.frame = view.bounds
view.addSubview(pageView)

//2. 设置FlexPageView的代理
pageView.delegate = self //FlexPageViewDelegate
pageView.dataSource = self //FlexPageViewDataSource
pageView.uiSource = self //FlexPageViewUISource

//3. 实现代理方法
//FlexPageViewDelegate
func didRemovePage(_ page: UIView, at index: Int) {}
func pageWillAppear(_ page: UIView, at index: Int) {}
func pageWillDisappear(_ page: UIView, at index: Int) {}
func extraViewAction() {}

//FlexPageViewDataSource
func numberOfPage() -> Int {return 0}
func titleDatas() -> [IMenuViewCellData] {return []}
func page(at index: Int) -> UIView {return UIView()}
func pageID(at index: Int) -> Int {return index}

//FlexPageViewUISource
func register() -> [String: UICollectionViewCell.Type] {return ["MenuViewCellData": MenuViewCellData.self]}

Design & Author

iOS切换标签组件 FlexPageView

Latest podspec

{
    "name": "FlexPageView",
    "version": "0.1.0",
    "summary": "A segment view who can switch page by slide and click",
    "description": "A segment view who can switch page by slide and click",
    "homepage": "https://github.com/nullLuli/FlexPageView",
    "license": "MIT",
    "authors": {
        "nullluli": "[email protected]"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/nullLuli/FlexPageView.git",
        "tag": "0.1.0"
    },
    "source_files": "FlexPageViewDemo/FlexPageView/*.swift"
}

Pin It on Pinterest

Share This