Latest 1.0.0
Homepage https://github.com/CorkiiOS/CKPagerComponent
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform

Show

image

Describe

比较常用的选项卡多页面管理器,低耦合,不需要继承,使用CKPagingManager实例进行管理。

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

  • import "CKPagingManager.h"

  • 实例化(强引用)
 manager = [CKPagingManager manager];
 manager.delegate = self;
  • 实现委托

  • 选项卡风格
//后续有时间扩展
typedef NS_ENUM(NSInteger , CKPagingComponentBarStyle) {

    CKPagingComponentStyleNormal,//普通
    CKPagingComponentStyleControl,//系统的pagecontrol
};

- (CKPagingComponentBarStyle)style {

    return CKPagingComponentStyleControl;
}
  • 控制器集合
/**

 控制器集合
 @return 控制器集合
 */
- (NSArray<UIViewController *> *)pagingControllerComponentChildViewControllers {

    return @[[CKTestVC1 new],
             [CKTestVC2 new],
             [CKTestVC1 new],
             [CKTestVC2 new],
             [CKTestVC1 new],
             [CKTestVC2 new],
             [CKTestVC2 new],
             [CKTestVC1 new],
             [CKTestVC2 new]
             ];
}
  • 选项卡标题集合
- (NSArray<NSString *> *)pagingControllerComponentSegmentTitles {

    return @[@"热门",@"精华",
             @"热门",@"精华",
             @"热门",@"精华",@"精华",
             @"热门",@"精华"];
}
  • 选项卡位置
- (CGRect)pagingControllerComponentSegmentFrame {

    return CGRectMake(0, 64, self.view.bounds.size.width, 44);
}
  • 控制器view高度
- (CGFloat)pagingControllerComponentContainerViewHeight {

    return self.view.bounds.size.height - 64;
}
  • 选项卡配置
 [manager loadPagingWithConfig:^(CKSegmentBarConfig *config) {
            //标题普通颜色
        config.nor_color([UIColor darkGrayColor]);
        //标题选中颜色
        config.sel_color([UIColor orangeColor]);
        //下划线颜色
        config.line_color([UIColor orangeColor]);
        //选项卡背景颜色
        config.backgroundColor = [UIColor clearColor];
    }];

Installation

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

pod "CKPagerComponent"

Author

corki, [email protected]

License

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

Latest podspec

{
    "name": "CKPagerComponent",
    "version": "1.0.0",
    "summary": "CKPagerComponent.",
    "description": "CKPagerComponent.pageManager",
    "homepage": "https://github.com/CorkiiOS/CKPagerComponent",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "corkiios": "[email protected]"
    },
    "source": {
        "git": "https://github.com/CorkiiOS/CKPagerComponent.git",
        "tag": "1.0.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "CKPagerComponent/Classes/**/*"
}

Pin It on Pinterest

Share This