Commit d197c76aa6afb51e2d348d9e2b7ca9c954ae24f1
1 parent
396a99a2
no message
Showing
13 changed files
with
72 additions
and
9 deletions
CNLiveServices/Classes/Classification/CNLiveClassificationServiceProtocol.h
| @@ -10,8 +10,6 @@ | @@ -10,8 +10,6 @@ | ||
| 10 | #import "BHServiceProtocol.h" | 10 | #import "BHServiceProtocol.h" |
| 11 | 11 | ||
| 12 | @protocol CNLiveClassificationServiceProtocol <NSObject, BHServiceProtocol> | 12 | @protocol CNLiveClassificationServiceProtocol <NSObject, BHServiceProtocol> |
| 13 | -//传值 | ||
| 14 | -@property (nonatomic, strong) NSString *itemId; | ||
| 15 | 13 | ||
| 16 | 14 | ||
| 17 | @end | 15 | @end |
CNLiveServices/Classes/Found/CNLiveFoundServiceProtocol.h
| @@ -10,11 +10,11 @@ | @@ -10,11 +10,11 @@ | ||
| 10 | #import "BHServiceProtocol.h" | 10 | #import "BHServiceProtocol.h" |
| 11 | 11 | ||
| 12 | @protocol CNLiveFoundServiceProtocol <NSObject, BHServiceProtocol> | 12 | @protocol CNLiveFoundServiceProtocol <NSObject, BHServiceProtocol> |
| 13 | -//传值 | 13 | +// 传值 |
| 14 | @property (nonatomic, strong) NSString *itemId; | 14 | @property (nonatomic, strong) NSString *itemId; |
| 15 | + | ||
| 15 | - (UIViewController *)getFoundViewController; | 16 | - (UIViewController *)getFoundViewController; |
| 16 | - (void)pushToFoundViewController; | 17 | - (void)pushToFoundViewController; |
| 17 | - | ||
| 18 | - (void)pushToFoundViewControllerByName:(NSString *)name url:(NSString *)url delegate:(id)delegate; | 18 | - (void)pushToFoundViewControllerByName:(NSString *)name url:(NSString *)url delegate:(id)delegate; |
| 19 | 19 | ||
| 20 | @end | 20 | @end |
CNLiveServices/Classes/Home/CNLiveHomeServiceProtocol.h
CNLiveServices/Classes/Login/CNLiveLoginServiceProtocol.h
| @@ -10,6 +10,9 @@ | @@ -10,6 +10,9 @@ | ||
| 10 | #import "BHServiceProtocol.h" | 10 | #import "BHServiceProtocol.h" |
| 11 | 11 | ||
| 12 | @protocol CNLiveLoginServiceProtocol <NSObject, BHServiceProtocol> | 12 | @protocol CNLiveLoginServiceProtocol <NSObject, BHServiceProtocol> |
| 13 | +// 传值 | ||
| 14 | +@property (nonatomic, strong) NSString *itemId; | ||
| 15 | + | ||
| 13 | //登录 | 16 | //登录 |
| 14 | - (UIViewController *)getLoginViewController; | 17 | - (UIViewController *)getLoginViewController; |
| 15 | - (void)pushToLoginViewController; | 18 | - (void)pushToLoginViewController; |
CNLiveServices/Classes/My/CNLiveMyServiceProtocol.h
| @@ -10,8 +10,6 @@ | @@ -10,8 +10,6 @@ | ||
| 10 | #import "BHServiceProtocol.h" | 10 | #import "BHServiceProtocol.h" |
| 11 | 11 | ||
| 12 | @protocol CNLiveMyServiceProtocol <NSObject, BHServiceProtocol> | 12 | @protocol CNLiveMyServiceProtocol <NSObject, BHServiceProtocol> |
| 13 | -//传值 | ||
| 14 | -@property (nonatomic, strong) NSString *itemId; | ||
| 15 | 13 | ||
| 16 | 14 | ||
| 17 | @end | 15 | @end |
Example/CNLiveServices/CNLiveAppDelegate.m
| @@ -8,6 +8,7 @@ | @@ -8,6 +8,7 @@ | ||
| 8 | 8 | ||
| 9 | #import "CNLiveAppDelegate.h" | 9 | #import "CNLiveAppDelegate.h" |
| 10 | #import "CNLiveServices.h" | 10 | #import "CNLiveServices.h" |
| 11 | + | ||
| 11 | #import "BHTimeProfiler.h" | 12 | #import "BHTimeProfiler.h" |
| 12 | #import <mach-o/dyld.h> | 13 | #import <mach-o/dyld.h> |
| 13 | #import "BHModuleManager.h" | 14 | #import "BHModuleManager.h" |
| @@ -27,7 +28,10 @@ | @@ -27,7 +28,10 @@ | ||
| 27 | [[BHTimeProfiler sharedTimeProfiler] recordEventTime:@"BeeHive::super start launch"]; | 28 | [[BHTimeProfiler sharedTimeProfiler] recordEventTime:@"BeeHive::super start launch"]; |
| 28 | 29 | ||
| 29 | [super application:application didFinishLaunchingWithOptions:launchOptions]; | 30 | [super application:application didFinishLaunchingWithOptions:launchOptions]; |
| 30 | - | 31 | + |
| 32 | +// id<CNLiveEnvironmentServiceProtocol> environment = [[BeeHive shareInstance] createService:@protocol(CNLiveEnvironmentServiceProtocol)]; | ||
| 33 | +// [environment setEnvironment:CNLiveProductionAppStore]; | ||
| 34 | + | ||
| 31 | id<CNLiveLoginServiceProtocol> login = [[BeeHive shareInstance] createService:@protocol(CNLiveLoginServiceProtocol)]; | 35 | id<CNLiveLoginServiceProtocol> login = [[BeeHive shareInstance] createService:@protocol(CNLiveLoginServiceProtocol)]; |
| 32 | UINavigationController *navCtrl = [[UINavigationController alloc] initWithRootViewController:[login getLoginViewController]]; | 36 | UINavigationController *navCtrl = [[UINavigationController alloc] initWithRootViewController:[login getLoginViewController]]; |
| 33 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; | 37 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; |
Example/CNLiveServices/Found/CNLiveFoundService.m
| @@ -34,10 +34,13 @@ | @@ -34,10 +34,13 @@ | ||
| 34 | - (void)pushToFoundViewControllerByName:(NSString *)name url:(NSString *)url delegate:(id)delegate{ | 34 | - (void)pushToFoundViewControllerByName:(NSString *)name url:(NSString *)url delegate:(id)delegate{ |
| 35 | UINavigationController *nav = (UINavigationController *)[UIApplication sharedApplication].delegate.window.rootViewController; | 35 | UINavigationController *nav = (UINavigationController *)[UIApplication sharedApplication].delegate.window.rootViewController; |
| 36 | CNLiveFoundViewController *vc = [CNLiveFoundViewController new]; | 36 | CNLiveFoundViewController *vc = [CNLiveFoundViewController new]; |
| 37 | + _itemId = name; | ||
| 38 | + vc.ID = _itemId; | ||
| 37 | vc.url = url; | 39 | vc.url = url; |
| 38 | vc.name = name; | 40 | vc.name = name; |
| 39 | vc.delegate = delegate; | 41 | vc.delegate = delegate; |
| 40 | [nav pushViewController:vc animated:YES]; | 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,6 +13,7 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 13 | 13 | ||
| 14 | @interface CNLiveFoundViewController : UIViewController | 14 | @interface CNLiveFoundViewController : UIViewController |
| 15 | @property (nonatomic, weak) id <CNLiveFoundProtocol> delegate; | 15 | @property (nonatomic, weak) id <CNLiveFoundProtocol> delegate; |
| 16 | +@property (nonatomic, copy) NSString *ID; | ||
| 16 | @property (nonatomic, copy) NSString *name; | 17 | @property (nonatomic, copy) NSString *name; |
| 17 | @property (nonatomic, copy) NSString *url; | 18 | @property (nonatomic, copy) NSString *url; |
| 18 | 19 |
Example/CNLiveServices/Home/CNLiveHomeService.m
| @@ -9,6 +9,7 @@ | @@ -9,6 +9,7 @@ | ||
| 9 | #import "CNLiveHomeService.h" | 9 | #import "CNLiveHomeService.h" |
| 10 | #import "CNLiveServices.h" | 10 | #import "CNLiveServices.h" |
| 11 | #import "CNLiveHomeViewController.h" | 11 | #import "CNLiveHomeViewController.h" |
| 12 | +#import "CNLiveDetailsViewController.h" | ||
| 12 | 13 | ||
| 13 | @BeeHiveService(CNLiveHomeServiceProtocol,CNLiveHomeService) | 14 | @BeeHiveService(CNLiveHomeServiceProtocol,CNLiveHomeService) |
| 14 | @interface CNLiveHomeService ()<CNLiveHomeServiceProtocol> | 15 | @interface CNLiveHomeService ()<CNLiveHomeServiceProtocol> |
| @@ -24,9 +25,27 @@ | @@ -24,9 +25,27 @@ | ||
| 24 | } | 25 | } |
| 25 | 26 | ||
| 26 | - (void)pushToHomeViewController{ | 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 | UITabBarController *tab = (UITabBarController *)[UIApplication sharedApplication].delegate.window.rootViewController; | 46 | UITabBarController *tab = (UITabBarController *)[UIApplication sharedApplication].delegate.window.rootViewController; |
| 28 | UINavigationController *nav = tab.selectedViewController; | 47 | UINavigationController *nav = tab.selectedViewController; |
| 29 | - CNLiveHomeViewController *vc = [CNLiveHomeViewController new]; | 48 | + CNLiveDetailsViewController *vc = [CNLiveDetailsViewController new]; |
| 30 | [nav pushViewController:vc animated:YES]; | 49 | [nav pushViewController:vc animated:YES]; |
| 31 | 50 | ||
| 32 | } | 51 | } |
Example/CNLiveServices/Home/CNLiveHomeViewController.m
| @@ -24,7 +24,7 @@ | @@ -24,7 +24,7 @@ | ||
| 24 | [super viewDidLoad]; | 24 | [super viewDidLoad]; |
| 25 | 25 | ||
| 26 | // Do any additional setup after loading the view. | 26 | // Do any additional setup after loading the view. |
| 27 | - self.title = self.name; | 27 | + self.title = @"首页"; |
| 28 | self.view.backgroundColor = [UIColor whiteColor]; | 28 | self.view.backgroundColor = [UIColor whiteColor]; |
| 29 | 29 | ||
| 30 | UIButton *btn0 = [UIButton buttonWithType:UIButtonTypeCustom]; | 30 | UIButton *btn0 = [UIButton buttonWithType:UIButtonTypeCustom]; |
| @@ -46,6 +46,8 @@ | @@ -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,6 +7,7 @@ | ||
| 7 | // | 7 | // |
| 8 | 8 | ||
| 9 | #import "CNLoginViewController.h" | 9 | #import "CNLoginViewController.h" |
| 10 | +#import "CNLiveServices.h" | ||
| 10 | 11 | ||
| 11 | @interface CNLoginViewController () | 12 | @interface CNLoginViewController () |
| 12 | 13 | ||
| @@ -29,8 +30,35 @@ | @@ -29,8 +30,35 @@ | ||
| 29 | // Do any additional setup after loading the view. | 30 | // Do any additional setup after loading the view. |
| 30 | self.view.backgroundColor = [UIColor whiteColor]; | 31 | self.view.backgroundColor = [UIColor whiteColor]; |
| 31 | self.title = @"登录"; | 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 | #pragma mark - Navigation | 63 | #pragma mark - Navigation |
| 36 | 64 |
Example/CNLiveServices/Login/Module/CNLiveLoginService.m
| @@ -16,6 +16,7 @@ | @@ -16,6 +16,7 @@ | ||
| 16 | @end | 16 | @end |
| 17 | 17 | ||
| 18 | @implementation CNLiveLoginService | 18 | @implementation CNLiveLoginService |
| 19 | +@synthesize itemId = _itemId; | ||
| 19 | 20 | ||
| 20 | - (UIViewController *)getLoginViewController{ | 21 | - (UIViewController *)getLoginViewController{ |
| 21 | return [CNLoginViewController new]; | 22 | return [CNLoginViewController new]; |