Latest 0.1.0
Homepage https://github.com/CodeGeekXu/CGContainerController
License MIT
Platforms ios 8.0
Dependencies CGSegmentBar, Masonry
Authors

CI Status
Version
License
Platform

Installation

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

pod 'CGContainerController'

Demo

gif

Usage

@interface ContainerController : CGContainerController

@end

- (instancetype)init
{
    CGViewController *page1 = [CGViewController new];
    page1.view.backgroundColor = [UIColor whiteColor];

    CGViewController *page2 = [CGViewController new];
    page2.view.backgroundColor = [UIColor redColor];

    CGViewController *page3 = [CGViewController new];
    page3.view.backgroundColor = [UIColor greenColor];

    self = [super initWithTitles:@[@"Page 1",@"Page 2",@"Page 3"]
                childControllers:@[page1,page2,page3]
                segmentBarHeight:40];
    if (self) {
        self.segmentBar.indicatorColor = [UIColor blueColor];
        self.segmentBar.widthStyle = CGSegmentBarWidthStyleDynamic;
        self.segmentBar.interitemSpacing = 40;
        self.segmentBar.paddingInsets = UIEdgeInsetsMake(0, 20, 0, 20);
        self.segmentBar.selectedTextAttributes = @{NSFontAttributeName:[UIFont systemFontOfSize:16],
                                                   NSForegroundColorAttributeName:[UIColor blueColor]};
        [self.segmentBar reload];
    }
    return self;
}

Requirements

Author

CodeGeekXu, [email protected]

License

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

Latest podspec

{
    "name": "CGContainerController",
    "version": "0.1.0",
    "summary": "CGContainerController",
    "description": "A reusable page container similar to TopBuzz home page (u4e00u4e2au7c7bu4f3cu4e8eu4ecau65e5u5934u6761u9996u9875u7684u53efu4ee5u590du7528u7684u9875u9762u5bb9u5668)",
    "homepage": "https://github.com/CodeGeekXu/CGContainerController",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "CodeGeekXu": "[email protected]"
    },
    "source": {
        "git": "https://github.com/CodeGeekXu/CGContainerController.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "CGContainerController/Classes/**/*",
    "dependencies": {
        "CGSegmentBar": [],
        "Masonry": []
    }
}

Pin It on Pinterest

Share This