- clone 仓库,打开Example中的.xcworkspace,可查看效果.
- clone 仓库后,将BGIndicateView.h/m , BGSegementController.h/m 四个文件拖入项目即可.(说明:BGIndicateView后期补充多种指示器的样式,用户也可自行添加)
- cocoaPods安装:
pod "BGSegementController"
- #import "BGSegementController.h"
- 初始化segementController.
- 设置segementController的viewControllers数组.(存放子控制器的数组)
- segementController作为其他控制的childViewController使用,勿忘下面操作.
[currenController.view addSubview:pagesContainer.view];
[currenController.view addChildViewController:pagesContainer];
//eg:
- (void)methodName
{
[self.view addSubview:pagesContainer.view];
[self addChildViewController:pagesContainer];
}
- BGSegementController目前通过实现scrollerView的delegate方法,控制显示效果.而我死来想去,正在通过kvo方式达到一样的效果.正在拼命写代码...(后期待上传)
后期将优化,通过collectionView实现,本仓库作废!