Commit d197c76aa6afb51e2d348d9e2b7ca9c954ae24f1
1 parent
396a99a2
no message
Showing
13 changed files
with
72 additions
and
9 deletions
CNLiveServices/Classes/Classification/CNLiveClassificationServiceProtocol.h
CNLiveServices/Classes/Found/CNLiveFoundServiceProtocol.h
| ... | ... | @@ -10,11 +10,11 @@ |
| 10 | 10 | #import "BHServiceProtocol.h" |
| 11 | 11 | |
| 12 | 12 | @protocol CNLiveFoundServiceProtocol <NSObject, BHServiceProtocol> |
| 13 | -//传值 | |
| 13 | +// 传值 | |
| 14 | 14 | @property (nonatomic, strong) NSString *itemId; |
| 15 | + | |
| 15 | 16 | - (UIViewController *)getFoundViewController; |
| 16 | 17 | - (void)pushToFoundViewController; |
| 17 | - | |
| 18 | 18 | - (void)pushToFoundViewControllerByName:(NSString *)name url:(NSString *)url delegate:(id)delegate; |
| 19 | 19 | |
| 20 | 20 | @end | ... | ... |
CNLiveServices/Classes/Home/CNLiveHomeServiceProtocol.h
CNLiveServices/Classes/Login/CNLiveLoginServiceProtocol.h
| ... | ... | @@ -10,6 +10,9 @@ |
| 10 | 10 | #import "BHServiceProtocol.h" |
| 11 | 11 | |
| 12 | 12 | @protocol CNLiveLoginServiceProtocol <NSObject, BHServiceProtocol> |
| 13 | +// 传值 | |
| 14 | +@property (nonatomic, strong) NSString *itemId; | |
| 15 | + | |
| 13 | 16 | //登录 |
| 14 | 17 | - (UIViewController *)getLoginViewController; |
| 15 | 18 | - (void)pushToLoginViewController; | ... | ... |
CNLiveServices/Classes/My/CNLiveMyServiceProtocol.h
Example/CNLiveServices/CNLiveAppDelegate.m
| ... | ... | @@ -8,6 +8,7 @@ |
| 8 | 8 | |
| 9 | 9 | #import "CNLiveAppDelegate.h" |
| 10 | 10 | #import "CNLiveServices.h" |
| 11 | + | |
| 11 | 12 | #import "BHTimeProfiler.h" |
| 12 | 13 | #import <mach-o/dyld.h> |
| 13 | 14 | #import "BHModuleManager.h" |
| ... | ... | @@ -27,7 +28,10 @@ |
| 27 | 28 | [[BHTimeProfiler sharedTimeProfiler] recordEventTime:@"BeeHive::super start launch"]; |
| 28 | 29 | |
| 29 | 30 | [super application:application didFinishLaunchingWithOptions:launchOptions]; |
| 30 | - | |
| 31 | + | |
| 32 | +// id<CNLiveEnvironmentServiceProtocol> environment = [[BeeHive shareInstance] createService:@protocol(CNLiveEnvironmentServiceProtocol)]; | |
| 33 | +// [environment setEnvironment:CNLiveProductionAppStore]; | |
| 34 | + | |
| 31 | 35 | id<CNLiveLoginServiceProtocol> login = [[BeeHive shareInstance] createService:@protocol(CNLiveLoginServiceProtocol)]; |
| 32 | 36 | UINavigationController *navCtrl = [[UINavigationController alloc] initWithRootViewController:[login getLoginViewController]]; |
| 33 | 37 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; | ... | ... |
Example/CNLiveServices/Found/CNLiveFoundService.m
| ... | ... | @@ -34,10 +34,13 @@ |
| 34 | 34 | - (void)pushToFoundViewControllerByName:(NSString *)name url:(NSString *)url delegate:(id)delegate{ |
| 35 | 35 | UINavigationController *nav = (UINavigationController *)[UIApplication sharedApplication].delegate.window.rootViewController; |
| 36 | 36 | CNLiveFoundViewController *vc = [CNLiveFoundViewController new]; |
| 37 | + _itemId = name; | |
| 38 | + vc.ID = _itemId; | |
| 37 | 39 | vc.url = url; |
| 38 | 40 | vc.name = name; |
| 39 | 41 | vc.delegate = delegate; |
| 40 | 42 | [nav pushViewController:vc animated:YES]; |
| 43 | + NSLog(@"------%@------",self.itemId); | |
| 41 | 44 | |
| 42 | 45 | } |
| 43 | 46 | ... | ... |
Example/CNLiveServices/Found/CNLiveFoundViewController.h
| ... | ... | @@ -13,6 +13,7 @@ NS_ASSUME_NONNULL_BEGIN |
| 13 | 13 | |
| 14 | 14 | @interface CNLiveFoundViewController : UIViewController |
| 15 | 15 | @property (nonatomic, weak) id <CNLiveFoundProtocol> delegate; |
| 16 | +@property (nonatomic, copy) NSString *ID; | |
| 16 | 17 | @property (nonatomic, copy) NSString *name; |
| 17 | 18 | @property (nonatomic, copy) NSString *url; |
| 18 | 19 | ... | ... |
Example/CNLiveServices/Home/CNLiveHomeService.m
| ... | ... | @@ -9,6 +9,7 @@ |
| 9 | 9 | #import "CNLiveHomeService.h" |
| 10 | 10 | #import "CNLiveServices.h" |
| 11 | 11 | #import "CNLiveHomeViewController.h" |
| 12 | +#import "CNLiveDetailsViewController.h" | |
| 12 | 13 | |
| 13 | 14 | @BeeHiveService(CNLiveHomeServiceProtocol,CNLiveHomeService) |
| 14 | 15 | @interface CNLiveHomeService ()<CNLiveHomeServiceProtocol> |
| ... | ... | @@ -24,9 +25,27 @@ |
| 24 | 25 | } |
| 25 | 26 | |
| 26 | 27 | - (void)pushToHomeViewController{ |
| 28 | +// UITabBarController *tab = (UITabBarController *)[UIApplication sharedApplication].delegate.window.rootViewController; | |
| 29 | +// UINavigationController *nav = tab.selectedViewController; | |
| 30 | +// CNLiveHomeViewController *vc = [CNLiveHomeViewController new]; | |
| 31 | +// [nav pushViewController:vc animated:YES]; | |
| 32 | + | |
| 33 | + UINavigationController *nav = (UINavigationController *)[UIApplication sharedApplication].delegate.window.rootViewController; | |
| 34 | + CNLiveHomeViewController *vc = [CNLiveHomeViewController new]; | |
| 35 | + [nav pushViewController:vc animated:YES]; | |
| 36 | + | |
| 37 | +} | |
| 38 | + | |
| 39 | +- (UIViewController *)getDetailsViewController{ | |
| 40 | + CNLiveDetailsViewController *vc = [CNLiveDetailsViewController new]; | |
| 41 | + return vc; | |
| 42 | + | |
| 43 | +} | |
| 44 | + | |
| 45 | +- (void)pushToDetailsViewController{ | |
| 27 | 46 | UITabBarController *tab = (UITabBarController *)[UIApplication sharedApplication].delegate.window.rootViewController; |
| 28 | 47 | UINavigationController *nav = tab.selectedViewController; |
| 29 | - CNLiveHomeViewController *vc = [CNLiveHomeViewController new]; | |
| 48 | + CNLiveDetailsViewController *vc = [CNLiveDetailsViewController new]; | |
| 30 | 49 | [nav pushViewController:vc animated:YES]; |
| 31 | 50 | |
| 32 | 51 | } | ... | ... |
Example/CNLiveServices/Home/CNLiveHomeViewController.m
| ... | ... | @@ -24,7 +24,7 @@ |
| 24 | 24 | [super viewDidLoad]; |
| 25 | 25 | |
| 26 | 26 | // Do any additional setup after loading the view. |
| 27 | - self.title = self.name; | |
| 27 | + self.title = @"首页"; | |
| 28 | 28 | self.view.backgroundColor = [UIColor whiteColor]; |
| 29 | 29 | |
| 30 | 30 | UIButton *btn0 = [UIButton buttonWithType:UIButtonTypeCustom]; |
| ... | ... | @@ -46,6 +46,8 @@ |
| 46 | 46 | |
| 47 | 47 | } |
| 48 | 48 | }]; |
| 49 | +// id<CNLiveFoundServiceProtocol> found = [[BeeHive shareInstance] createService:@protocol(CNLiveFoundServiceProtocol)]; | |
| 50 | +// [found pushToFoundViewControllerByName:@"itemID" url:@"" delegate:self]; | |
| 49 | 51 | } |
| 50 | 52 | |
| 51 | 53 | /* | ... | ... |
Example/CNLiveServices/Login/Controller/CNLoginViewController.m
| ... | ... | @@ -7,6 +7,7 @@ |
| 7 | 7 | // |
| 8 | 8 | |
| 9 | 9 | #import "CNLoginViewController.h" |
| 10 | +#import "CNLiveServices.h" | |
| 10 | 11 | |
| 11 | 12 | @interface CNLoginViewController () |
| 12 | 13 | |
| ... | ... | @@ -29,8 +30,35 @@ |
| 29 | 30 | // Do any additional setup after loading the view. |
| 30 | 31 | self.view.backgroundColor = [UIColor whiteColor]; |
| 31 | 32 | self.title = @"登录"; |
| 33 | + | |
| 34 | + UIButton *btn0 = [UIButton buttonWithType:UIButtonTypeCustom]; | |
| 35 | + btn0.frame = CGRectMake(0, 0, 100, 100); | |
| 36 | + btn0.center = self.view.center; | |
| 37 | + btn0.backgroundColor = [UIColor redColor]; | |
| 38 | + [btn0 setTitle:@"进入首页" forState:UIControlStateNormal]; | |
| 39 | + [btn0 addTarget:self action:@selector(testButtonClicked) forControlEvents:UIControlEventTouchUpInside]; | |
| 40 | + [self.view addSubview:btn0]; | |
| 41 | + | |
| 42 | + | |
| 43 | + UIButton *btn1 = [UIButton buttonWithType:UIButtonTypeCustom]; | |
| 44 | + btn1.frame = CGRectMake([UIScreen mainScreen].bounds.size.width/2.0-50, 100, 100, 100); | |
| 45 | + btn1.backgroundColor = [UIColor redColor]; | |
| 46 | + [btn1 setTitle:@"登录" forState:UIControlStateNormal]; | |
| 47 | + [btn1 addTarget:self action:@selector(testButtonClicked1) forControlEvents:UIControlEventTouchUpInside]; | |
| 48 | + [self.view addSubview:btn1]; | |
| 32 | 49 | } |
| 33 | 50 | |
| 51 | +- (void)testButtonClicked { | |
| 52 | + id<CNLiveHomeServiceProtocol> home = [[BeeHive shareInstance] createService:@protocol(CNLiveHomeServiceProtocol)]; | |
| 53 | + [home pushToHomeViewController]; | |
| 54 | +} | |
| 55 | + | |
| 56 | +- (void)testButtonClicked1 { | |
| 57 | + [self dismissViewControllerAnimated:YES completion:^{ | |
| 58 | + self.completeBlock? self.completeBlock(YES):@""; | |
| 59 | + | |
| 60 | + }]; | |
| 61 | +} | |
| 34 | 62 | /* |
| 35 | 63 | #pragma mark - Navigation |
| 36 | 64 | ... | ... |
Example/CNLiveServices/Login/Module/CNLiveLoginService.m