Commit 401b43bd653e1e60345c05fa10b01d48586c9f02
1 parent
b086d257
no message
Showing
6 changed files
with
32 additions
and
13 deletions
CNLiveQrCodeModule/Classes/Controller/CNLiveGenerateCodeController.h renamed to CNLiveQrCodeModule/Classes/Controller/CNLiveGenerateQrCodeController.h
| 1 | // | 1 | // |
| 2 | -// CNLiveGenerateCodeController.h | 2 | +// CNLiveGenerateQrCodeController.h |
| 3 | // CNLiveQrCodeModule | 3 | // CNLiveQrCodeModule |
| 4 | // | 4 | // |
| 5 | // Created by 153993236@qq.com on 11/12/2019. | 5 | // Created by 153993236@qq.com on 11/12/2019. |
| @@ -14,7 +14,8 @@ | @@ -14,7 +14,8 @@ | ||
| 14 | 14 | ||
| 15 | NS_ASSUME_NONNULL_BEGIN | 15 | NS_ASSUME_NONNULL_BEGIN |
| 16 | 16 | ||
| 17 | -@interface CNLiveGenerateCodeController : UIViewController | 17 | +@interface CNLiveGenerateQrCodeController : UIViewController |
| 18 | +@property (nonatomic, copy) NSString *ID; | ||
| 18 | 19 | ||
| 19 | @end | 20 | @end |
| 20 | 21 |
CNLiveQrCodeModule/Classes/Controller/CNLiveGenerateCodeController.m renamed to CNLiveQrCodeModule/Classes/Controller/CNLiveGenerateQrCodeController.m
| 1 | // | 1 | // |
| 2 | -// CNLiveGenerateCodeController.m | 2 | +// CNLiveGenerateQrCodeController.m |
| 3 | // CNLiveQrCodeModule | 3 | // CNLiveQrCodeModule |
| 4 | // | 4 | // |
| 5 | // Created by 153993236@qq.com on 11/12/2019. | 5 | // Created by 153993236@qq.com on 11/12/2019. |
| 6 | // Copyright (c) 2019 153993236@qq.com. All rights reserved. | 6 | // Copyright (c) 2019 153993236@qq.com. All rights reserved. |
| 7 | // | 7 | // |
| 8 | 8 | ||
| 9 | -#import "CNLiveGenerateCodeController.h" | 9 | +#import "CNLiveGenerateQrCodeController.h" |
| 10 | #import <Photos/Photos.h> | 10 | #import <Photos/Photos.h> |
| 11 | #import <Accelerate/Accelerate.h> | 11 | #import <Accelerate/Accelerate.h> |
| 12 | 12 | ||
| @@ -18,17 +18,19 @@ | @@ -18,17 +18,19 @@ | ||
| 18 | #import "CNLiveGenerateCodeView.h" | 18 | #import "CNLiveGenerateCodeView.h" |
| 19 | #import "CNLiveScanQrCodeController.h" | 19 | #import "CNLiveScanQrCodeController.h" |
| 20 | 20 | ||
| 21 | -@interface CNLiveGenerateCodeController ()<CNLiveQrCodeNavigationBarDelegate,QMUIAlertControllerDelegate> | 21 | +@interface CNLiveGenerateQrCodeController ()<CNLiveQrCodeNavigationBarDelegate,QMUIAlertControllerDelegate> |
| 22 | @property (nonatomic, strong) CNLiveQrCodeNavigationBar *navigationBar; | 22 | @property (nonatomic, strong) CNLiveQrCodeNavigationBar *navigationBar; |
| 23 | @property (nonatomic, strong) UIImageView *bgView; | 23 | @property (nonatomic, strong) UIImageView *bgView; |
| 24 | @property (nonatomic, strong) CNLiveGenerateCodeView *qrCodeView; | 24 | @property (nonatomic, strong) CNLiveGenerateCodeView *qrCodeView; |
| 25 | 25 | ||
| 26 | @end | 26 | @end |
| 27 | 27 | ||
| 28 | -@implementation CNLiveGenerateCodeController | 28 | +@implementation CNLiveGenerateQrCodeController |
| 29 | static const NSInteger margin = 20; | 29 | static const NSInteger margin = 20; |
| 30 | static const CGFloat timeValue = 1.5; | 30 | static const CGFloat timeValue = 1.5; |
| 31 | - | 31 | +- (void)setID:(NSString *)ID{ |
| 32 | + _ID = ID; | ||
| 33 | +} | ||
| 32 | #pragma mark - 生命周期 | 34 | #pragma mark - 生命周期 |
| 33 | - (void)viewWillAppear:(BOOL)animated{ | 35 | - (void)viewWillAppear:(BOOL)animated{ |
| 34 | [super viewWillAppear:animated]; | 36 | [super viewWillAppear:animated]; |
| @@ -47,7 +49,7 @@ static const CGFloat timeValue = 1.5; | @@ -47,7 +49,7 @@ static const CGFloat timeValue = 1.5; | ||
| 47 | } | 49 | } |
| 48 | 50 | ||
| 49 | - (void)dealloc { | 51 | - (void)dealloc { |
| 50 | - NSLog(@"CNLiveGenerateCodeController -- dealloc"); | 52 | + NSLog(@"CNLiveGenerateQrCodeController -- dealloc"); |
| 51 | 53 | ||
| 52 | } | 54 | } |
| 53 | 55 | ||
| @@ -221,7 +223,7 @@ static const CGFloat timeValue = 1.5; | @@ -221,7 +223,7 @@ static const CGFloat timeValue = 1.5; | ||
| 221 | } | 223 | } |
| 222 | - (CNLiveGenerateCodeView *)qrCodeView { | 224 | - (CNLiveGenerateCodeView *)qrCodeView { |
| 223 | if (!_qrCodeView) { | 225 | if (!_qrCodeView) { |
| 224 | - _qrCodeView = [[CNLiveGenerateCodeView alloc]initWithID:@"asdasr"]; | 226 | + _qrCodeView = [[CNLiveGenerateCodeView alloc]initWithID:self.ID]; |
| 225 | _qrCodeView.frame = CGRectMake(0, 0, SCREEN_WIDTH-2*margin, SCREEN_WIDTH-2*margin+40); | 227 | _qrCodeView.frame = CGRectMake(0, 0, SCREEN_WIDTH-2*margin, SCREEN_WIDTH-2*margin+40); |
| 226 | _qrCodeView.center = self.view.center; | 228 | _qrCodeView.center = self.view.center; |
| 227 | } | 229 | } |
CNLiveQrCodeModule/Classes/Controller/CNLiveGroupQrCodeController.h
CNLiveQrCodeModule/Classes/Controller/CNLiveScanResultController.h
| @@ -6,6 +6,10 @@ | @@ -6,6 +6,10 @@ | ||
| 6 | // Copyright (c) 2019 153993236@qq.com. All rights reserved. | 6 | // Copyright (c) 2019 153993236@qq.com. All rights reserved. |
| 7 | // | 7 | // |
| 8 | 8 | ||
| 9 | +/** | ||
| 10 | + * 扫码结果 | ||
| 11 | + */ | ||
| 12 | + | ||
| 9 | #import <UIKit/UIKit.h> | 13 | #import <UIKit/UIKit.h> |
| 10 | 14 | ||
| 11 | @interface CNLiveScanResultController : UIViewController | 15 | @interface CNLiveScanResultController : UIViewController |
CNLiveQrCodeModule/Classes/Module/CNLiveQrCodeService.m
| @@ -14,6 +14,8 @@ | @@ -14,6 +14,8 @@ | ||
| 14 | #import "CNLiveMyQrCodeController.h" | 14 | #import "CNLiveMyQrCodeController.h" |
| 15 | // 群二维码名片 | 15 | // 群二维码名片 |
| 16 | #import "CNLiveGroupQrCodeController.h" | 16 | #import "CNLiveGroupQrCodeController.h" |
| 17 | +// 生成二维码 | ||
| 18 | +#import "CNLiveGenerateQrCodeController.h" | ||
| 17 | 19 | ||
| 18 | @BeeHiveService(CNLiveQrCodeServiceProtocol,CNLiveQrCodeService) | 20 | @BeeHiveService(CNLiveQrCodeServiceProtocol,CNLiveQrCodeService) |
| 19 | @interface CNLiveQrCodeService ()<CNLiveQrCodeServiceProtocol> | 21 | @interface CNLiveQrCodeService ()<CNLiveQrCodeServiceProtocol> |
| @@ -54,4 +56,15 @@ | @@ -54,4 +56,15 @@ | ||
| 54 | // [CNLivePageJumpManager pushViewController:vc]; | 56 | // [CNLivePageJumpManager pushViewController:vc]; |
| 55 | } | 57 | } |
| 56 | 58 | ||
| 59 | +// 生成二维码 | ||
| 60 | +- (UIViewController *)getGenerateQrCodeController { | ||
| 61 | + return [CNLiveGenerateQrCodeController new]; | ||
| 62 | +} | ||
| 63 | + | ||
| 64 | +- (void)pushToGenerateQrCodeController:(NSString *)ID { | ||
| 65 | + CNLiveGenerateQrCodeController *vc = [[CNLiveGenerateQrCodeController alloc]init]; | ||
| 66 | + vc.ID = ID; | ||
| 67 | +// [CNLivePageJumpManager pushViewController:vc]; | ||
| 68 | +} | ||
| 69 | + | ||
| 57 | @end | 70 | @end |
Example/CNLiveQrCodeModule/CNLIVEAppDelegate.m
| @@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
| 11 | #import "CNLiveScanQrCodeController.h" | 11 | #import "CNLiveScanQrCodeController.h" |
| 12 | #import "CNLiveGroupQrCodeController.h" | 12 | #import "CNLiveGroupQrCodeController.h" |
| 13 | #import "CNLiveScanResultController.h" | 13 | #import "CNLiveScanResultController.h" |
| 14 | -#import "CNLiveGenerateCodeController.h" | 14 | +#import "CNLiveGenerateQrCodeController.h" |
| 15 | 15 | ||
| 16 | #import "CNLiveNetworking.h" | 16 | #import "CNLiveNetworking.h" |
| 17 | #import "CNLiveEnvironment.h" | 17 | #import "CNLiveEnvironment.h" |
| @@ -63,8 +63,8 @@ | @@ -63,8 +63,8 @@ | ||
| 63 | }]; | 63 | }]; |
| 64 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; | 64 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; |
| 65 | 65 | ||
| 66 | - CNLiveGenerateCodeController *vc = [[CNLiveGenerateCodeController alloc] init]; | ||
| 67 | -// vc.jump_URL = @"http://www.baidu.com"; | 66 | + CNLiveGenerateQrCodeController *vc = [[CNLiveGenerateQrCodeController alloc] init]; |
| 67 | + vc.ID = @"http://www.baidu.com"; | ||
| 68 | UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:vc]; | 68 | UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:vc]; |
| 69 | 69 | ||
| 70 | self.window.rootViewController = nav;//设置根视图控制器 | 70 | self.window.rootViewController = nav;//设置根视图控制器 |