JLCustomPagingView 0.1.5

JLCustomPagingView 0.1.5

测试已测试
语言语言 SwiftSwift
许可证 MIT
发布上次发布2016年5月
SPM支持 SPM

Jose Lucas 维护。



  • 作者
  • José Lucas

JLCustomPagingView

使用

要运行示例项目,首先克隆仓库,然后从 Example 目录中运行 pod install

要求

安装

JLCustomPagingView 可以通过 CocoaPods 获得。要安装它,只需将以下行添加到你的 Podfile 中

pod "JLCustomPagingView"

初始配置

第一步

在每个使用此框架的文件中导入它。

import JLCustomPagingView
第二步

打开包含你想要创建 JLCustomPagingView 实例的视图控制器的 Storyboard,为视图控制器添加一个视图,放置你想要的全部约束,然后你需要说明该视图是一个 JLCustomPagingView 并创建一个指向此 JLCustomPagingView 的输出。

@IBOutlet weak var myPagingView: JLCustomPagingView!
第三步

创建相应的输出后,你应该实现接口 CustomPagingViewDataSourceCustomPagingViewDelegate

class ViewController: UIViewController,CustomPagingViewDataSource,CustomPagingViewDelegate

技巧

重新加载数据
reloadData()
CustomPagingViewDataSource 方法

你想要拥有的项目数量

numbOfItems()->Int

应该保持在索引处的项目

itemAtIndex(index:Int)->UIView!
CustomPagingViewDelegate 方法

此方法被调用以了解对应索引处的项目是否应识别触摸事件

shouldItemReceiveTapEvents(ItemAtIndex index:Int)->Bool

当用户触摸顶部项时调用此方法

didSelectItemWithIndex(index:Int,item:UIView)

当顶部可见项(活动项)更改时调用此方法

didChangeTopItemIndexTo(newTopItemIndex:Int,lastTopItemIndex:Int)

作者

José Lucas

许可证

JLCustomPagingView遵循MIT许可证。有关更多信息,请参阅LICENSE文件。