Latest 0.0.1
Homepage https://github.com/FreeBaiShun/BSTwoControllerView
License MIT
Platforms ios 8.0, requires ARC
Authors

点击按钮实现两个界面的切换,如果用一个controller管理,那么代码显得过于庞大。这时候用BSTwoControllerView可以优雅的把代码分在两个controller来管理。

效果

image

用法

pod ‘BSTwoControllerView’

#import "ViewController.h"
#import "OneVC.h"
#import "TwoVC.h"
#import "BSTwoControllerView/BSTwoControllerView.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet BSTwoControllerView *viewBottom;

@end

@implementation ViewController{
OneVC *oneVC;
TwoVC *twoVC;
}

- (void)viewDidLoad {
[super viewDidLoad];

oneVC = [OneVC new];
twoVC = [TwoVC new];
[self.viewBottom initTwoControllerWithMainController:self controller1:oneVC controller2:twoVC];
}
- (IBAction)btnOneVC:(id)sender {
[self.viewBottom setDisplayWithController:oneVC];
}

- (IBAction)btnTwoVC:(id)sender {
[self.viewBottom setDisplayWithController:twoVC];
}

@end

Latest podspec

{
    "name": "BSTwoControllerView",
    "version": "0.0.1",
    "summary": "A short description of BSTwoControllerView.",
    "description": "u4e24u4e2acontrolleru5207u6362",
    "homepage": "https://github.com/FreeBaiShun/BSTwoControllerView",
    "license": "MIT",
    "authors": {
        "FreeBaiShun": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source": {
        "git": "https://github.com/FreeBaiShun/BSTwoControllerView.git",
        "tag": "0.0.1"
    },
    "subspecs": [
        {
            "name": "Core",
            "source_files": [
                "BSTwoControllerViewDemo",
                "BSTwoControllerViewDemo/BSTwoControllerView/*.{h,m}"
            ]
        }
    ]
}

Pin It on Pinterest

Share This