Commit 39544de27f05906e07099949bc6fb99d56a0679e

Authored by zhangxiaowen
1 parent 33bbaab3

no message

Showing 41 changed files with 133 additions and 1957 deletions
CNLiveServices.podspec
@@ -33,23 +33,23 @@ TODO: Add long description of the pod here. @@ -33,23 +33,23 @@ TODO: Add long description of the pod here.
33 s.source_files = 'CNLiveServices/Classes/CNLiveServices.h' 33 s.source_files = 'CNLiveServices/Classes/CNLiveServices.h'
34 34
35 # 首页 35 # 首页
36 - s.subspec 'Home' do |ss|  
37 - ss.source_files = 'CNLiveServices/Classes/Home/*.{h,m}' 36 + s.subspec 'NetHome' do |ss|
  37 + ss.source_files = 'CNLiveServices/Classes/NetHome/*.{h,m}'
38 end 38 end
39 39
40 - # 分类  
41 - s.subspec 'Classification' do |ss|  
42 - ss.source_files = 'CNLiveServices/Classes/Classification/*.{h,m}' 40 + # 视讯(分类)
  41 + s.subspec 'Category' do |ss|
  42 + ss.source_files = 'CNLiveServices/Classes/Category/*.{h,m}'
43 end 43 end
44 44
45 - # 我的  
46 - s.subspec 'My' do |ss|  
47 - ss.source_files = 'CNLiveServices/Classes/My/*.{h,m}' 45 + # 服务
  46 + s.subspec 'Service' do |ss|
  47 + ss.source_files = 'CNLiveServices/Classes/Service/*.{h,m}'
48 end 48 end
49 49
50 - # 发现  
51 - s.subspec 'Found' do |ss|  
52 - ss.source_files = 'CNLiveServices/Classes/Found/*.{h,m}' 50 + # 我的
  51 + s.subspec 'Mine' do |ss|
  52 + ss.source_files = 'CNLiveServices/Classes/Mine/*.{h,m}'
53 end 53 end
54 54
55 # 登录 55 # 登录
@@ -57,18 +57,12 @@ TODO: Add long description of the pod here. @@ -57,18 +57,12 @@ TODO: Add long description of the pod here.
57 ss.source_files = 'CNLiveServices/Classes/Login/*.{h,m}' 57 ss.source_files = 'CNLiveServices/Classes/Login/*.{h,m}'
58 end 58 end
59 59
60 - # 用户协议  
61 - s.subspec 'UserAgreement' do |ss|  
62 - ss.source_files = 'CNLiveServices/Classes/UserAgreement/*.{h,m}'  
63 - end  
64 -  
65 # s.resource_bundles = { 60 # s.resource_bundles = {
66 # 'CNLiveServices' => ['CNLiveServices/Assets/*.png'] 61 # 'CNLiveServices' => ['CNLiveServices/Assets/*.png']
67 # } 62 # }
68 63
69 # s.public_header_files = 'Pod/Classes/**/*.h' 64 # s.public_header_files = 'Pod/Classes/**/*.h'
70 # s.frameworks = 'UIKit', 'MapKit' 65 # s.frameworks = 'UIKit', 'MapKit'
71 - s.dependency 'BeeHive'  
72 - s.dependency 'CNLiveEnvironment' 66 + s.dependency 'CNLiveBeeHive'
73 67
74 end 68 end
CNLiveServices/Classes/CNLiveServices.h
1 // 1 //
2 // CNLiveServices.h 2 // CNLiveServices.h
3 -// TestBH 3 +// CNLiveServices
4 // 4 //
5 -// Created by CNLive-zxw on 2019/7/22.  
6 -// Copyright © 2019 XW. All rights reserved. 5 +// Created by 153993236@qq.com on 07/22/2019.
  6 +// Copyright (c) 2019 153993236@qq.com. All rights reserved.
7 // 7 //
8 8
9 #ifndef CNLiveServices_h 9 #ifndef CNLiveServices_h
@@ -11,23 +11,20 @@ @@ -11,23 +11,20 @@
11 11
12 #import "BeeHive.h" 12 #import "BeeHive.h"
13 13
14 -//首页  
15 -#import "CNLiveHomeServiceProtocol.h" 14 +// 首页
  15 +#import "CNLiveNetHomeServiceProtocol.h"
16 16
17 -//分类  
18 -#import "CNLiveClassificationServiceProtocol.h" 17 +// 分类
  18 +#import "CNLiveCategoryServiceProtocol.h"
19 19
20 -//我的  
21 -#import "CNLiveMyServiceProtocol.h" 20 +// 服务
  21 +#import "CNLiveServiceServiceProtocol.h"
22 22
23 -//发现  
24 -#import "CNLiveFoundServiceProtocol.h" 23 +// 我的
  24 +#import "CNLiveMineServiceProtocol.h"
25 25
26 -//登录 26 +// 登录
27 #import "CNLiveLoginServiceProtocol.h" 27 #import "CNLiveLoginServiceProtocol.h"
28 28
29 -//用户协议  
30 -#import "CNLiveUserAgreementServiceProtocol.h"  
31 -  
32 29
33 #endif /* CNLiveServices_h */ 30 #endif /* CNLiveServices_h */
CNLiveServices/Classes/Category/CNLiveCategoryServiceProtocol.h 0 → 100644
  1 +//
  2 +// CNLiveCategoryServiceProtocol.h
  3 +// CNLiveServices
  4 +//
  5 +// Created by 153993236@qq.com on 07/22/2019.
  6 +// Copyright (c) 2019 153993236@qq.com. All rights reserved.
  7 +//
  8 +
  9 +#import <Foundation/Foundation.h>
  10 +#import "BHServiceProtocol.h"
  11 +
  12 +@protocol CNLiveCategoryServiceProtocol <NSObject, BHServiceProtocol>
  13 +//首页
  14 +- (UIViewController *)getCategoryViewController;
  15 +- (void)pushToCategoryViewController;
  16 +
  17 +@end
CNLiveServices/Classes/Classification/CNLiveClassificationServiceProtocol.h deleted 100644 → 0
1 -//  
2 -// CNLiveClassificationServiceProtocol.h  
3 -// TestBH  
4 -//  
5 -// Created by CNLive-zxw on 2019/7/22.  
6 -// Copyright © 2019 XW. All rights reserved.  
7 -//  
8 -  
9 -#import <Foundation/Foundation.h>  
10 -#import "BHServiceProtocol.h"  
11 -  
12 -@protocol CNLiveClassificationServiceProtocol <NSObject, BHServiceProtocol>  
13 -  
14 -  
15 -@end  
CNLiveServices/Classes/Found/CNLiveFoundServiceProtocol.h deleted 100644 → 0
1 -//  
2 -// CNLiveFoundServiceProtocol.h  
3 -// TestBH  
4 -//  
5 -// Created by CNLive-zxw on 2019/7/22.  
6 -// Copyright © 2019 XW. All rights reserved.  
7 -//  
8 -  
9 -#import <Foundation/Foundation.h>  
10 -#import "BHServiceProtocol.h"  
11 -  
12 -@protocol CNLiveFoundServiceProtocol <NSObject, BHServiceProtocol>  
13 -// 传值  
14 -@property (nonatomic, strong) NSString *itemId;  
15 -  
16 -- (UIViewController *)getFoundViewController;  
17 -- (void)pushToFoundViewController;  
18 -- (void)pushToFoundViewControllerByName:(NSString *)name url:(NSString *)url delegate:(id)delegate;  
19 -  
20 -@end  
21 -  
22 -  
23 -//回调传值  
24 -@protocol CNLiveFoundProtocol <NSObject>  
25 -//传值  
26 -- (void)backToFoundViewControllerByName:(NSString *)name;  
27 -  
28 -@end  
CNLiveServices/Classes/Login/CNLiveLoginServiceProtocol.h
1 // 1 //
2 // CNLiveLoginServiceProtocol.h 2 // CNLiveLoginServiceProtocol.h
3 -// TestBH 3 +// CNLiveServices
4 // 4 //
5 -// Created by CNLive-zxw on 2019/7/22.  
6 -// Copyright © 2019 XW. All rights reserved. 5 +// Created by 153993236@qq.com on 07/22/2019.
  6 +// Copyright (c) 2019 153993236@qq.com. All rights reserved.
7 // 7 //
8 8
9 #import <Foundation/Foundation.h> 9 #import <Foundation/Foundation.h>
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 //登录
17 - (UIViewController *)getLoginViewController; 15 - (UIViewController *)getLoginViewController;
CNLiveServices/Classes/Mine/CNLiveMineServiceProtocol.h 0 → 100644
  1 +//
  2 +// CNLiveMineServiceProtocol.h
  3 +// CNLiveServices
  4 +//
  5 +// Created by 153993236@qq.com on 07/22/2019.
  6 +// Copyright (c) 2019 153993236@qq.com. All rights reserved.
  7 +//
  8 +
  9 +#import <Foundation/Foundation.h>
  10 +#import "BHServiceProtocol.h"
  11 +
  12 +@protocol CNLiveMineServiceProtocol <NSObject, BHServiceProtocol>
  13 +
  14 +//首页
  15 +- (UIViewController *)getMineViewController;
  16 +- (void)pushToMineViewController;
  17 +
  18 +
  19 +@end
CNLiveServices/Classes/My/CNLiveMyServiceProtocol.h deleted 100644 → 0
1 -//  
2 -// CNLiveMyServiceProtocol.h  
3 -// TestBH  
4 -//  
5 -// Created by CNLive-zxw on 2019/7/22.  
6 -// Copyright © 2019 XW. All rights reserved.  
7 -//  
8 -  
9 -#import <Foundation/Foundation.h>  
10 -#import "BHServiceProtocol.h"  
11 -  
12 -@protocol CNLiveMyServiceProtocol <NSObject, BHServiceProtocol>  
13 -  
14 -  
15 -@end  
CNLiveServices/Classes/Home/CNLiveHomeServiceProtocol.h renamed to CNLiveServices/Classes/NetHome/CNLiveNetHomeServiceProtocol.h
1 // 1 //
2 -// CNLiveHomeServiceProtocol.h  
3 -// TestBH 2 +// CNLiveNetHomeServiceProtocol.h
  3 +// CNLiveServices
4 // 4 //
5 -// Created by CNLive-zxw on 2019/7/22.  
6 -// Copyright © 2019 XW. All rights reserved. 5 +// Created by 153993236@qq.com on 07/22/2019.
  6 +// Copyright (c) 2019 153993236@qq.com. All rights reserved.
7 // 7 //
8 8
9 #import <Foundation/Foundation.h> 9 #import <Foundation/Foundation.h>
10 #import "BHServiceProtocol.h" 10 #import "BHServiceProtocol.h"
11 11
12 -@protocol CNLiveHomeServiceProtocol <NSObject, BHServiceProtocol> 12 +@protocol CNLiveNetHomeServiceProtocol <NSObject, BHServiceProtocol>
13 13
14 //首页 14 //首页
15 - (UIViewController *)getHomeViewController; 15 - (UIViewController *)getHomeViewController;
16 - (void)pushToHomeViewController; 16 - (void)pushToHomeViewController;
17 17
18 18
19 -//详情  
20 -- (UIViewController *)getDetailsViewController;  
21 -- (void)pushToDetailsViewController;  
22 -  
23 @end 19 @end
CNLiveServices/Classes/Service/CNLiveServiceServiceProtocol.h 0 → 100644
  1 +//
  2 +// CNLiveServiceServiceProtocol.h
  3 +// CNLiveServices
  4 +//
  5 +// Created by 153993236@qq.com on 07/22/2019.
  6 +// Copyright (c) 2019 153993236@qq.com. All rights reserved.
  7 +//
  8 +
  9 +#import <Foundation/Foundation.h>
  10 +#import "BHServiceProtocol.h"
  11 +
  12 +@protocol CNLiveServiceServiceProtocol <NSObject, BHServiceProtocol>
  13 +// 传值
  14 +@property (nonatomic, strong) NSString *itemId;
  15 +
  16 +- (UIViewController *)getServiceViewController;
  17 +- (void)pushToServiceViewController;
  18 +- (void)pushToServiceViewControllerByName:(NSString *)name url:(NSString *)url delegate:(id)delegate;
  19 +
  20 +@end
CNLiveServices/Classes/UserAgreement/CNLiveUserAgreementServiceProtocol.h deleted 100644 → 0
1 -//  
2 -// CNLiveUserAgreementServiceProtocol.h  
3 -// TestBH  
4 -//  
5 -// Created by CNLive-zxw on 2019/7/22.  
6 -// Copyright © 2019 XW. All rights reserved.  
7 -//  
8 -  
9 -#import <Foundation/Foundation.h>  
10 -#import "BHServiceProtocol.h"  
11 -typedef void(^SuccessBlock)(NSString *h5, NSString *title);  
12 -typedef void(^FailureBlock)(NSError *error);  
13 -typedef enum {  
14 - CNAgreementUser    = 1001,//用户协议  
15 - CNAgreementPrivacy    = 1002,//隐私政策  
16 - CNAgreementHelp    = 1003,//帮助与反馈  
17 - CNAgreementUnderstand    = 1004,//使用手册  
18 - CNAgreementIntroduction    = 1005,//应用简介  
19 - CNAgreementCopyright    = 1006,//版权信息  
20 - CNAgreementPermission    = 1007,//软件许可及服务协议  
21 - CNAgreementIntegralRules    = 1008,//积分规则  
22 - CNAgreementSigninRules    = 1009,//签到奖励规则  
23 - CNAgreementReviewApply    = 1010,//复核申请  
24 - CNAgreementCancellation    = 1011,//注销协议  
25 - CNAgreementEmojiService    = 1012,//表情包服务说明  
26 - CNAgreementEmojiComplaints    = 1013,//表情包投诉说明  
27 - CNAgreementEnterpriseQualification = 1014,//企业资质  
28 -  
29 -} CNGetAgreementH5Type;  
30 -  
31 -@protocol CNLiveUserAgreementServiceProtocol <NSObject, BHServiceProtocol>  
32 -  
33 -+ (void)jumpToAgreementH5WithType:(CNGetAgreementH5Type)type;  
34 -  
35 -+ (void)getAgreementH5WithType:(CNGetAgreementH5Type)type success:(SuccessBlock)success failure:(FailureBlock)failure;  
36 -  
37 -- (void)getAgreementH5WithType:(CNGetAgreementH5Type)type success:(SuccessBlock)success failure:(FailureBlock)failure;  
38 -  
39 -@end  
Example/CNLiveServices.xcodeproj/project.pbxproj
@@ -7,21 +7,10 @@ @@ -7,21 +7,10 @@
7 objects = { 7 objects = {
8 8
9 /* Begin PBXBuildFile section */ 9 /* Begin PBXBuildFile section */
10 - 08109F1E22FC3CBC0008A577 /* CNLiveFoundService.m in Sources */ = {isa = PBXBuildFile; fileRef = 08109F1A22FC3CBC0008A577 /* CNLiveFoundService.m */; };  
11 - 08109F1F22FC3CBC0008A577 /* CNLiveFoundModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 08109F1B22FC3CBC0008A577 /* CNLiveFoundModule.m */; };  
12 - 08109F2422FC3CDA0008A577 /* CNLiveHomeService.m in Sources */ = {isa = PBXBuildFile; fileRef = 08109F2022FC3CDA0008A577 /* CNLiveHomeService.m */; };  
13 - 08109F2522FC3CDA0008A577 /* CNLiveHomeModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 08109F2222FC3CDA0008A577 /* CNLiveHomeModule.m */; };  
14 - 08303C8422E8093300510DE9 /* CNUserAgreementManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 08303C8322E8093300510DE9 /* CNUserAgreementManager.m */; };  
15 - 0833CE9A22EFE03200AA3B2C /* CNUserAgreementWebController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0833CE9922EFE03200AA3B2C /* CNUserAgreementWebController.m */; };  
16 - 084124BC22E70027006699C6 /* CNLiveDetailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 084124BB22E70027006699C6 /* CNLiveDetailsViewController.m */; };  
17 - 084124C622E702C6006699C6 /* CNLiveFoundViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 084124C522E702C6006699C6 /* CNLiveFoundViewController.m */; };  
18 - 084356B5231CFDBA006BD702 /* CNLiveUserInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 084356B4231CFDBA006BD702 /* CNLiveUserInfoModel.m */; };  
19 - 084356B8231D10F8006BD702 /* CNLiveUserRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 084356B7231D10F8006BD702 /* CNLiveUserRequest.m */; };  
20 - 0882D6A422E5AE1B000859E7 /* CNLiveLoginService.m in Sources */ = {isa = PBXBuildFile; fileRef = 0882D6A322E5AE1B000859E7 /* CNLiveLoginService.m */; };  
21 - 0882D6A722E5AEB2000859E7 /* CNLoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0882D6A622E5AEB2000859E7 /* CNLoginViewController.m */; };  
22 - 0882D6AA22E5AEDB000859E7 /* CNLiveLoginModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 0882D6A922E5AEDB000859E7 /* CNLiveLoginModule.m */; };  
23 - 0882D6B822E5B3D1000859E7 /* CNLiveHomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0882D6B722E5B3D1000859E7 /* CNLiveHomeViewController.m */; };  
24 - 08A5393122FC22C000CDA315 /* CNLiveUserInfoManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 08A5393022FC22C000CDA315 /* CNLiveUserInfoManager.m */; }; 10 + 085CD873237A919A004131E7 /* CNLiveHomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 085CD86A237A919A004131E7 /* CNLiveHomeViewController.m */; };
  11 + 085CD874237A919A004131E7 /* CNLiveDetailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 085CD86B237A919A004131E7 /* CNLiveDetailsViewController.m */; };
  12 + 085CD875237A919A004131E7 /* CNLiveHomeModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 085CD86E237A919A004131E7 /* CNLiveHomeModule.m */; };
  13 + 085CD876237A919A004131E7 /* CNLiveHomeService.m in Sources */ = {isa = PBXBuildFile; fileRef = 085CD870237A919A004131E7 /* CNLiveHomeService.m */; };
25 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 14 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; };
26 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; 15 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; };
27 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 16 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
@@ -51,39 +40,14 @@ @@ -51,39 +40,14 @@
51 /* End PBXContainerItemProxy section */ 40 /* End PBXContainerItemProxy section */
52 41
53 /* Begin PBXFileReference section */ 42 /* Begin PBXFileReference section */
54 - 08109F1A22FC3CBC0008A577 /* CNLiveFoundService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLiveFoundService.m; sourceTree = "<group>"; };  
55 - 08109F1B22FC3CBC0008A577 /* CNLiveFoundModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLiveFoundModule.m; sourceTree = "<group>"; };  
56 - 08109F1C22FC3CBC0008A577 /* CNLiveFoundService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveFoundService.h; sourceTree = "<group>"; };  
57 - 08109F1D22FC3CBC0008A577 /* CNLiveFoundModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveFoundModule.h; sourceTree = "<group>"; };  
58 - 08109F2022FC3CDA0008A577 /* CNLiveHomeService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLiveHomeService.m; sourceTree = "<group>"; };  
59 - 08109F2122FC3CDA0008A577 /* CNLiveHomeModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveHomeModule.h; sourceTree = "<group>"; };  
60 - 08109F2222FC3CDA0008A577 /* CNLiveHomeModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLiveHomeModule.m; sourceTree = "<group>"; };  
61 - 08109F2322FC3CDA0008A577 /* CNLiveHomeService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveHomeService.h; sourceTree = "<group>"; };  
62 - 08303C8222E8093300510DE9 /* CNUserAgreementManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNUserAgreementManager.h; sourceTree = "<group>"; };  
63 - 08303C8322E8093300510DE9 /* CNUserAgreementManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNUserAgreementManager.m; sourceTree = "<group>"; };  
64 - 0833CE9822EFE03200AA3B2C /* CNUserAgreementWebController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNUserAgreementWebController.h; sourceTree = "<group>"; };  
65 - 0833CE9922EFE03200AA3B2C /* CNUserAgreementWebController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNUserAgreementWebController.m; sourceTree = "<group>"; };  
66 - 084124BA22E70027006699C6 /* CNLiveDetailsViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLiveDetailsViewController.h; sourceTree = "<group>"; };  
67 - 084124BB22E70027006699C6 /* CNLiveDetailsViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNLiveDetailsViewController.m; sourceTree = "<group>"; };  
68 - 084124C422E702C6006699C6 /* CNLiveFoundViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLiveFoundViewController.h; sourceTree = "<group>"; };  
69 - 084124C522E702C6006699C6 /* CNLiveFoundViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNLiveFoundViewController.m; sourceTree = "<group>"; };  
70 - 084356B3231CFDBA006BD702 /* CNLiveUserInfoModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLiveUserInfoModel.h; sourceTree = "<group>"; };  
71 - 084356B4231CFDBA006BD702 /* CNLiveUserInfoModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNLiveUserInfoModel.m; sourceTree = "<group>"; };  
72 - 084356B6231D10F8006BD702 /* CNLiveUserRequest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLiveUserRequest.h; sourceTree = "<group>"; };  
73 - 084356B7231D10F8006BD702 /* CNLiveUserRequest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNLiveUserRequest.m; sourceTree = "<group>"; };  
74 - 084356B9231D1128006BD702 /* CNLiveUserTypeDef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveUserTypeDef.h; sourceTree = "<group>"; };  
75 - 084356BA231D19A4006BD702 /* CNLiveUserUrl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLiveUserUrl.h; sourceTree = "<group>"; };  
76 - 084356BB231D1DDE006BD702 /* CNLiveUserCenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLiveUserCenter.h; sourceTree = "<group>"; };  
77 - 0882D6A222E5AE1B000859E7 /* CNLiveLoginService.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLiveLoginService.h; sourceTree = "<group>"; };  
78 - 0882D6A322E5AE1B000859E7 /* CNLiveLoginService.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNLiveLoginService.m; sourceTree = "<group>"; };  
79 - 0882D6A522E5AEB2000859E7 /* CNLoginViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLoginViewController.h; sourceTree = "<group>"; };  
80 - 0882D6A622E5AEB2000859E7 /* CNLoginViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNLoginViewController.m; sourceTree = "<group>"; };  
81 - 0882D6A822E5AEDB000859E7 /* CNLiveLoginModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLiveLoginModule.h; sourceTree = "<group>"; };  
82 - 0882D6A922E5AEDB000859E7 /* CNLiveLoginModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNLiveLoginModule.m; sourceTree = "<group>"; };  
83 - 0882D6B622E5B3D1000859E7 /* CNLiveHomeViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLiveHomeViewController.h; sourceTree = "<group>"; };  
84 - 0882D6B722E5B3D1000859E7 /* CNLiveHomeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNLiveHomeViewController.m; sourceTree = "<group>"; };  
85 - 08A5392F22FC22C000CDA315 /* CNLiveUserInfoManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLiveUserInfoManager.h; sourceTree = "<group>"; };  
86 - 08A5393022FC22C000CDA315 /* CNLiveUserInfoManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNLiveUserInfoManager.m; sourceTree = "<group>"; }; 43 + 085CD86A237A919A004131E7 /* CNLiveHomeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLiveHomeViewController.m; sourceTree = "<group>"; };
  44 + 085CD86B237A919A004131E7 /* CNLiveDetailsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLiveDetailsViewController.m; sourceTree = "<group>"; };
  45 + 085CD86D237A919A004131E7 /* CNLiveHomeService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveHomeService.h; sourceTree = "<group>"; };
  46 + 085CD86E237A919A004131E7 /* CNLiveHomeModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLiveHomeModule.m; sourceTree = "<group>"; };
  47 + 085CD86F237A919A004131E7 /* CNLiveHomeModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveHomeModule.h; sourceTree = "<group>"; };
  48 + 085CD870237A919A004131E7 /* CNLiveHomeService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLiveHomeService.m; sourceTree = "<group>"; };
  49 + 085CD871237A919A004131E7 /* CNLiveHomeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveHomeViewController.h; sourceTree = "<group>"; };
  50 + 085CD872237A919A004131E7 /* CNLiveDetailsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveDetailsViewController.h; sourceTree = "<group>"; };
87 10E6387D4BC65CC1B77AD149 /* Pods-CNLiveServices_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveServices_Tests.debug.xcconfig"; path = "Target Support Files/Pods-CNLiveServices_Tests/Pods-CNLiveServices_Tests.debug.xcconfig"; sourceTree = "<group>"; }; 51 10E6387D4BC65CC1B77AD149 /* Pods-CNLiveServices_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveServices_Tests.debug.xcconfig"; path = "Target Support Files/Pods-CNLiveServices_Tests/Pods-CNLiveServices_Tests.debug.xcconfig"; sourceTree = "<group>"; };
88 1503DA066C26D47C2404BE70 /* Pods-CNLiveServices_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveServices_Example.release.xcconfig"; path = "Target Support Files/Pods-CNLiveServices_Example/Pods-CNLiveServices_Example.release.xcconfig"; sourceTree = "<group>"; }; 52 1503DA066C26D47C2404BE70 /* Pods-CNLiveServices_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveServices_Example.release.xcconfig"; path = "Target Support Files/Pods-CNLiveServices_Example/Pods-CNLiveServices_Example.release.xcconfig"; sourceTree = "<group>"; };
89 34A5EA5BE443520ED4522B2F /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; }; 53 34A5EA5BE443520ED4522B2F /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
@@ -140,115 +104,29 @@ @@ -140,115 +104,29 @@
140 /* End PBXFrameworksBuildPhase section */ 104 /* End PBXFrameworksBuildPhase section */
141 105
142 /* Begin PBXGroup section */ 106 /* Begin PBXGroup section */
143 - 081097E622FC30570008A577 /* Module */ = { 107 + 085CD869237A919A004131E7 /* Home */ = {
144 isa = PBXGroup; 108 isa = PBXGroup;
145 children = ( 109 children = (
146 - 08109F2122FC3CDA0008A577 /* CNLiveHomeModule.h */,  
147 - 08109F2222FC3CDA0008A577 /* CNLiveHomeModule.m */,  
148 - 08109F2322FC3CDA0008A577 /* CNLiveHomeService.h */,  
149 - 08109F2022FC3CDA0008A577 /* CNLiveHomeService.m */, 110 + 085CD86C237A919A004131E7 /* Module */,
  111 + 085CD871237A919A004131E7 /* CNLiveHomeViewController.h */,
  112 + 085CD86A237A919A004131E7 /* CNLiveHomeViewController.m */,
  113 + 085CD872237A919A004131E7 /* CNLiveDetailsViewController.h */,
  114 + 085CD86B237A919A004131E7 /* CNLiveDetailsViewController.m */,
150 ); 115 );
151 - path = Module;  
152 - sourceTree = "<group>";  
153 - };  
154 - 08109F1722FC30B70008A577 /* Module */ = {  
155 - isa = PBXGroup;  
156 - children = (  
157 - 08109F1D22FC3CBC0008A577 /* CNLiveFoundModule.h */,  
158 - 08109F1B22FC3CBC0008A577 /* CNLiveFoundModule.m */,  
159 - 08109F1C22FC3CBC0008A577 /* CNLiveFoundService.h */,  
160 - 08109F1A22FC3CBC0008A577 /* CNLiveFoundService.m */,  
161 - );  
162 - path = Module; 116 + path = Home;
163 sourceTree = "<group>"; 117 sourceTree = "<group>";
164 }; 118 };
165 - 08303C6322E7E23800510DE9 /* Module */ = { 119 + 085CD86C237A919A004131E7 /* Module */ = {
166 isa = PBXGroup; 120 isa = PBXGroup;
167 children = ( 121 children = (
168 - 0882D6A222E5AE1B000859E7 /* CNLiveLoginService.h */,  
169 - 0882D6A322E5AE1B000859E7 /* CNLiveLoginService.m */,  
170 - 0882D6A822E5AEDB000859E7 /* CNLiveLoginModule.h */,  
171 - 0882D6A922E5AEDB000859E7 /* CNLiveLoginModule.m */, 122 + 085CD86D237A919A004131E7 /* CNLiveHomeService.h */,
  123 + 085CD870237A919A004131E7 /* CNLiveHomeService.m */,
  124 + 085CD86F237A919A004131E7 /* CNLiveHomeModule.h */,
  125 + 085CD86E237A919A004131E7 /* CNLiveHomeModule.m */,
172 ); 126 );
173 path = Module; 127 path = Module;
174 sourceTree = "<group>"; 128 sourceTree = "<group>";
175 }; 129 };
176 - 08303C8A22E8427500510DE9 /* UserAgreement */ = {  
177 - isa = PBXGroup;  
178 - children = (  
179 - 08303C8222E8093300510DE9 /* CNUserAgreementManager.h */,  
180 - 08303C8322E8093300510DE9 /* CNUserAgreementManager.m */,  
181 - 0833CE9822EFE03200AA3B2C /* CNUserAgreementWebController.h */,  
182 - 0833CE9922EFE03200AA3B2C /* CNUserAgreementWebController.m */,  
183 - );  
184 - path = UserAgreement;  
185 - sourceTree = "<group>";  
186 - };  
187 - 084124BD22E701AE006699C6 /* Found */ = {  
188 - isa = PBXGroup;  
189 - children = (  
190 - 08109F1722FC30B70008A577 /* Module */,  
191 - 084124C422E702C6006699C6 /* CNLiveFoundViewController.h */,  
192 - 084124C522E702C6006699C6 /* CNLiveFoundViewController.m */,  
193 - );  
194 - path = Found;  
195 - sourceTree = "<group>";  
196 - };  
197 - 084124C722E72DDB006699C6 /* View */ = {  
198 - isa = PBXGroup;  
199 - children = (  
200 - );  
201 - path = View;  
202 - sourceTree = "<group>";  
203 - };  
204 - 084124C822E72DE4006699C6 /* Model */ = {  
205 - isa = PBXGroup;  
206 - children = (  
207 - 084356B9231D1128006BD702 /* CNLiveUserTypeDef.h */,  
208 - 08A5392F22FC22C000CDA315 /* CNLiveUserInfoManager.h */,  
209 - 08A5393022FC22C000CDA315 /* CNLiveUserInfoManager.m */,  
210 - 084356B3231CFDBA006BD702 /* CNLiveUserInfoModel.h */,  
211 - 084356B4231CFDBA006BD702 /* CNLiveUserInfoModel.m */,  
212 - 084356B6231D10F8006BD702 /* CNLiveUserRequest.h */,  
213 - 084356B7231D10F8006BD702 /* CNLiveUserRequest.m */,  
214 - 084356BA231D19A4006BD702 /* CNLiveUserUrl.h */,  
215 - 084356BB231D1DDE006BD702 /* CNLiveUserCenter.h */,  
216 - );  
217 - path = Model;  
218 - sourceTree = "<group>";  
219 - };  
220 - 084124C922E72DF2006699C6 /* Controller */ = {  
221 - isa = PBXGroup;  
222 - children = (  
223 - 0882D6A522E5AEB2000859E7 /* CNLoginViewController.h */,  
224 - 0882D6A622E5AEB2000859E7 /* CNLoginViewController.m */,  
225 - );  
226 - path = Controller;  
227 - sourceTree = "<group>";  
228 - };  
229 - 0882D6A122E5ADEA000859E7 /* Login */ = {  
230 - isa = PBXGroup;  
231 - children = (  
232 - 08303C6322E7E23800510DE9 /* Module */,  
233 - 084124C922E72DF2006699C6 /* Controller */,  
234 - 084124C822E72DE4006699C6 /* Model */,  
235 - 084124C722E72DDB006699C6 /* View */,  
236 - );  
237 - path = Login;  
238 - sourceTree = "<group>";  
239 - };  
240 - 0882D6AF22E5B393000859E7 /* Home */ = {  
241 - isa = PBXGroup;  
242 - children = (  
243 - 081097E622FC30570008A577 /* Module */,  
244 - 0882D6B622E5B3D1000859E7 /* CNLiveHomeViewController.h */,  
245 - 0882D6B722E5B3D1000859E7 /* CNLiveHomeViewController.m */,  
246 - 084124BA22E70027006699C6 /* CNLiveDetailsViewController.h */,  
247 - 084124BB22E70027006699C6 /* CNLiveDetailsViewController.m */,  
248 - );  
249 - path = Home;  
250 - sourceTree = "<group>";  
251 - };  
252 6003F581195388D10070C39A = { 130 6003F581195388D10070C39A = {
253 isa = PBXGroup; 131 isa = PBXGroup;
254 children = ( 132 children = (
@@ -286,12 +164,9 @@ @@ -286,12 +164,9 @@
286 6003F593195388D20070C39A /* Example for CNLiveServices */ = { 164 6003F593195388D20070C39A /* Example for CNLiveServices */ = {
287 isa = PBXGroup; 165 isa = PBXGroup;
288 children = ( 166 children = (
289 - 08303C8A22E8427500510DE9 /* UserAgreement */,  
290 - 084124BD22E701AE006699C6 /* Found */,  
291 - 0882D6AF22E5B393000859E7 /* Home */,  
292 - 0882D6A122E5ADEA000859E7 /* Login */,  
293 6003F59C195388D20070C39A /* CNLiveAppDelegate.h */, 167 6003F59C195388D20070C39A /* CNLiveAppDelegate.h */,
294 6003F59D195388D20070C39A /* CNLiveAppDelegate.m */, 168 6003F59D195388D20070C39A /* CNLiveAppDelegate.m */,
  169 + 085CD869237A919A004131E7 /* Home */,
295 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */, 170 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */,
296 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */, 171 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */,
297 6003F5A8195388D20070C39A /* Images.xcassets */, 172 6003F5A8195388D20070C39A /* Images.xcassets */,
@@ -487,25 +362,13 @@ @@ -487,25 +362,13 @@
487 buildActionMask = 2147483647; 362 buildActionMask = 2147483647;
488 files = ( 363 files = (
489 ); 364 );
490 - inputFileListPaths = (  
491 - );  
492 inputPaths = ( 365 inputPaths = (
493 "${PODS_ROOT}/Target Support Files/Pods-CNLiveServices_Example/Pods-CNLiveServices_Example-frameworks.sh", 366 "${PODS_ROOT}/Target Support Files/Pods-CNLiveServices_Example/Pods-CNLiveServices_Example-frameworks.sh",
494 - "${BUILT_PRODUCTS_DIR}/AFNetworking/AFNetworking.framework",  
495 - "${BUILT_PRODUCTS_DIR}/BeeHive/BeeHive.framework",  
496 - "${BUILT_PRODUCTS_DIR}/CNLiveEnvironment/CNLiveEnvironment.framework",  
497 - "${BUILT_PRODUCTS_DIR}/CNLiveRequestBastKit/CNLiveRequestBastKit.framework",  
498 - "${BUILT_PRODUCTS_DIR}/MJExtension/MJExtension.framework", 367 + "${BUILT_PRODUCTS_DIR}/CNLiveBeeHive/CNLiveBeeHive.framework",
499 ); 368 );
500 name = "[CP] Embed Pods Frameworks"; 369 name = "[CP] Embed Pods Frameworks";
501 - outputFileListPaths = (  
502 - );  
503 outputPaths = ( 370 outputPaths = (
504 - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AFNetworking.framework",  
505 - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/BeeHive.framework",  
506 - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveEnvironment.framework",  
507 - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveRequestBastKit.framework",  
508 - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MJExtension.framework", 371 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBeeHive.framework",
509 ); 372 );
510 runOnlyForDeploymentPostprocessing = 0; 373 runOnlyForDeploymentPostprocessing = 0;
511 shellPath = /bin/sh; 374 shellPath = /bin/sh;
@@ -541,23 +404,12 @@ @@ -541,23 +404,12 @@
541 isa = PBXSourcesBuildPhase; 404 isa = PBXSourcesBuildPhase;
542 buildActionMask = 2147483647; 405 buildActionMask = 2147483647;
543 files = ( 406 files = (
544 - 08109F2522FC3CDA0008A577 /* CNLiveHomeModule.m in Sources */,  
545 - 08109F1F22FC3CBC0008A577 /* CNLiveFoundModule.m in Sources */,  
546 - 08303C8422E8093300510DE9 /* CNUserAgreementManager.m in Sources */,  
547 - 084124BC22E70027006699C6 /* CNLiveDetailsViewController.m in Sources */,  
548 - 08109F2422FC3CDA0008A577 /* CNLiveHomeService.m in Sources */,  
549 - 0882D6AA22E5AEDB000859E7 /* CNLiveLoginModule.m in Sources */, 407 + 085CD875237A919A004131E7 /* CNLiveHomeModule.m in Sources */,
550 6003F59E195388D20070C39A /* CNLiveAppDelegate.m in Sources */, 408 6003F59E195388D20070C39A /* CNLiveAppDelegate.m in Sources */,
551 - 0882D6A722E5AEB2000859E7 /* CNLoginViewController.m in Sources */,  
552 - 08109F1E22FC3CBC0008A577 /* CNLiveFoundService.m in Sources */,  
553 - 0833CE9A22EFE03200AA3B2C /* CNUserAgreementWebController.m in Sources */,  
554 - 0882D6A422E5AE1B000859E7 /* CNLiveLoginService.m in Sources */,  
555 - 084356B8231D10F8006BD702 /* CNLiveUserRequest.m in Sources */,  
556 - 0882D6B822E5B3D1000859E7 /* CNLiveHomeViewController.m in Sources */,  
557 - 084124C622E702C6006699C6 /* CNLiveFoundViewController.m in Sources */,  
558 - 084356B5231CFDBA006BD702 /* CNLiveUserInfoModel.m in Sources */,  
559 - 08A5393122FC22C000CDA315 /* CNLiveUserInfoManager.m in Sources */, 409 + 085CD873237A919A004131E7 /* CNLiveHomeViewController.m in Sources */,
  410 + 085CD874237A919A004131E7 /* CNLiveDetailsViewController.m in Sources */,
560 6003F59A195388D20070C39A /* main.m in Sources */, 411 6003F59A195388D20070C39A /* main.m in Sources */,
  412 + 085CD876237A919A004131E7 /* CNLiveHomeService.m in Sources */,
561 ); 413 );
562 runOnlyForDeploymentPostprocessing = 0; 414 runOnlyForDeploymentPostprocessing = 0;
563 }; 415 };
Example/CNLiveServices/CNLiveAppDelegate.m
@@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
33 // id<CNLiveLoginServiceProtocol> login = [[BeeHive shareInstance] createService:@protocol(CNLiveLoginServiceProtocol)]; 33 // id<CNLiveLoginServiceProtocol> login = [[BeeHive shareInstance] createService:@protocol(CNLiveLoginServiceProtocol)];
34 // UINavigationController *navCtrl = [[UINavigationController alloc] initWithRootViewController:[login getLoginViewController]]; 34 // UINavigationController *navCtrl = [[UINavigationController alloc] initWithRootViewController:[login getLoginViewController]];
35 35
36 - id<CNLiveHomeServiceProtocol> home = [[BeeHive shareInstance] createService:@protocol(CNLiveHomeServiceProtocol)]; 36 + id<CNLiveNetHomeServiceProtocol> home = [[BeeHive shareInstance] createService:@protocol(CNLiveNetHomeServiceProtocol)];
37 UINavigationController *navCtrl = [[UINavigationController alloc] initWithRootViewController:[home getHomeViewController]]; 37 UINavigationController *navCtrl = [[UINavigationController alloc] initWithRootViewController:[home getHomeViewController]];
38 38
39 self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 39 self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
Example/CNLiveServices/Found/CNLiveFoundViewController.h deleted 100644 → 0
1 -//  
2 -// CNLiveFoundViewController.h  
3 -// CNLiveServices_Example  
4 -//  
5 -// Created by CNLive-zxw on 2019/7/23.  
6 -// Copyright © 2019 153993236@qq.com. All rights reserved.  
7 -//  
8 -  
9 -#import <UIKit/UIKit.h>  
10 -#import "CNLiveFoundServiceProtocol.h"  
11 -  
12 -NS_ASSUME_NONNULL_BEGIN  
13 -  
14 -@interface CNLiveFoundViewController : UIViewController  
15 -@property (nonatomic, weak) id <CNLiveFoundProtocol> delegate;  
16 -@property (nonatomic, copy) NSString *ID;  
17 -@property (nonatomic, copy) NSString *name;  
18 -@property (nonatomic, copy) NSString *url;  
19 -  
20 -@end  
21 -  
22 -NS_ASSUME_NONNULL_END  
Example/CNLiveServices/Found/CNLiveFoundViewController.m deleted 100644 → 0
1 -//  
2 -// CNLiveFoundViewController.m  
3 -// CNLiveServices_Example  
4 -//  
5 -// Created by CNLive-zxw on 2019/7/23.  
6 -// Copyright © 2019 153993236@qq.com. All rights reserved.  
7 -//  
8 -  
9 -#import "CNLiveFoundViewController.h"  
10 -#import "CNLiveUserInfoManager.h"  
11 -  
12 -@interface CNLiveFoundViewController ()  
13 -  
14 -@end  
15 -  
16 -@implementation CNLiveFoundViewController  
17 -  
18 -- (void)viewDidLoad {  
19 - [super viewDidLoad];  
20 - // Do any additional setup after loading the view.  
21 -  
22 - self.title = @"发现";  
23 - self.view.backgroundColor = [UIColor whiteColor];  
24 -  
25 - UIButton *btn0 = [UIButton buttonWithType:UIButtonTypeCustom];  
26 - btn0.frame = CGRectMake(0, 0, 100, 100);  
27 - btn0.center = self.view.center;  
28 - btn0.backgroundColor = [UIColor redColor];  
29 - [btn0 setTitle:@"回调传值" forState:UIControlStateNormal];  
30 - [btn0 addTarget:self action:@selector(testButtonClicked) forControlEvents:UIControlEventTouchUpInside];  
31 - [self.view addSubview:btn0];  
32 -  
33 - NSLog(@"姓名:%@, ID:%@, Token:%@, Head:%@",User_Name,User_ID,User_Token, User_Head);  
34 -  
35 -  
36 -}  
37 -  
38 -- (void)testButtonClicked {  
39 - if ([self.delegate respondsToSelector:@selector(backToFoundViewControllerByName:)]) {  
40 - [self.delegate backToFoundViewControllerByName:@"发现返回值是哈哈"];  
41 - }  
42 - UINavigationController *nav = (UINavigationController *)[UIApplication sharedApplication].delegate.window.rootViewController;  
43 - [nav popViewControllerAnimated:YES];  
44 -}  
45 -  
46 -/*  
47 -#pragma mark - Navigation  
48 -  
49 -// In a storyboard-based application, you will often want to do a little preparation before navigation  
50 -- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {  
51 - // Get the new view controller using [segue destinationViewController].  
52 - // Pass the selected object to the new view controller.  
53 -}  
54 -*/  
55 -  
56 -@end  
Example/CNLiveServices/Found/Module/CNLiveFoundModule.h deleted 100644 → 0
1 -//  
2 -// CNLiveFoundModule.h  
3 -// CNLiveServices_Example  
4 -//  
5 -// Created by CNLive-zxw on 2019/7/23.  
6 -// Copyright © 2019 153993236@qq.com. All rights reserved.  
7 -//  
8 -  
9 -#import <Foundation/Foundation.h>  
10 -  
11 -NS_ASSUME_NONNULL_BEGIN  
12 -  
13 -@interface CNLiveFoundModule : NSObject  
14 -  
15 -@end  
16 -  
17 -NS_ASSUME_NONNULL_END  
Example/CNLiveServices/Found/Module/CNLiveFoundModule.m deleted 100644 → 0
1 -//  
2 -// CNLiveFoundModule.m  
3 -// CNLiveServices_Example  
4 -//  
5 -// Created by CNLive-zxw on 2019/7/23.  
6 -// Copyright © 2019 153993236@qq.com. All rights reserved.  
7 -//  
8 -  
9 -#import "CNLiveFoundModule.h"  
10 -#import "BeeHive.h"  
11 -  
12 -@BeeHiveMod(CNLiveFoundModule)  
13 -@interface CNLiveFoundModule()<BHModuleProtocol>  
14 -  
15 -@end  
16 -  
17 -@implementation CNLiveFoundModule  
18 -- (id)init {  
19 - if (self = [super init]) {  
20 -  
21 - }  
22 - return self;  
23 -  
24 -}  
25 -  
26 -- (NSUInteger)moduleLevel {  
27 - return 0;  
28 -  
29 -}  
30 -  
31 -- (void)modSetUp:(BHContext *)context {  
32 -// NSLog(@"CNLiveFoundModule setup");  
33 - switch (context.env) {  
34 - case BHEnvironmentDev:  
35 - //....初始化开发环境  
36 - break;  
37 - case BHEnvironmentProd:  
38 - //....初始化生产环境  
39 - default:  
40 - break;  
41 - }  
42 -  
43 -}  
44 -  
45 -- (void)modInit:(BHContext *)context {  
46 -// NSLog(@"CNLiveFoundModule init");  
47 -  
48 -}  
49 -  
50 -- (void)modWillResignActive:(BHContext *)context{  
51 -  
52 -}  
53 -  
54 -- (void)modDidEnterBackground:(BHContext *)context{  
55 -  
56 -}  
57 -  
58 -- (void)modWillEnterForeground:(BHContext *)context{  
59 -  
60 -}  
61 -  
62 -- (void)modDidBecomeActive:(BHContext *)context{  
63 -  
64 -}  
65 -  
66 -- (void)modWillTerminate:(BHContext *)context{  
67 -  
68 -}  
69 -  
70 -@end  
Example/CNLiveServices/Found/Module/CNLiveFoundService.h deleted 100644 → 0
1 -//  
2 -// CNLiveFoundService.h  
3 -// CNLiveServices_Example  
4 -//  
5 -// Created by CNLive-zxw on 2019/7/23.  
6 -// Copyright © 2019 153993236@qq.com. All rights reserved.  
7 -//  
8 -  
9 -#import <Foundation/Foundation.h>  
10 -  
11 -NS_ASSUME_NONNULL_BEGIN  
12 -  
13 -@interface CNLiveFoundService : NSObject  
14 -  
15 -@end  
16 -  
17 -NS_ASSUME_NONNULL_END  
Example/CNLiveServices/Found/Module/CNLiveFoundService.m deleted 100644 → 0
1 -//  
2 -// CNLiveFoundService.m  
3 -// CNLiveServices_Example  
4 -//  
5 -// Created by CNLive-zxw on 2019/7/23.  
6 -// Copyright © 2019 153993236@qq.com. All rights reserved.  
7 -//  
8 -  
9 -#import "CNLiveFoundService.h"  
10 -#import "CNLiveServices.h"  
11 -#import "CNLiveFoundViewController.h"  
12 -  
13 -@BeeHiveService(CNLiveFoundServiceProtocol,CNLiveFoundService)  
14 -@interface CNLiveFoundService ()<CNLiveFoundServiceProtocol>  
15 -  
16 -@end  
17 -  
18 -@implementation CNLiveFoundService  
19 -@synthesize itemId = _itemId;  
20 -  
21 -- (UIViewController *)getFoundViewController{  
22 - CNLiveFoundViewController *vc = [CNLiveFoundViewController new];  
23 - return vc;  
24 -  
25 -}  
26 -  
27 -- (void)pushToFoundViewController{  
28 - UINavigationController *nav = (UINavigationController *)[UIApplication sharedApplication].delegate.window.rootViewController;  
29 - CNLiveFoundViewController *vc = [CNLiveFoundViewController new];  
30 - [nav pushViewController:vc animated:YES];  
31 -  
32 -}  
33 -  
34 -- (void)pushToFoundViewControllerByName:(NSString *)name url:(NSString *)url delegate:(id)delegate{  
35 - UINavigationController *nav = (UINavigationController *)[UIApplication sharedApplication].delegate.window.rootViewController;  
36 - CNLiveFoundViewController *vc = [CNLiveFoundViewController new];  
37 - _itemId = name;  
38 - vc.ID = _itemId;  
39 - vc.url = url;  
40 - vc.name = name;  
41 - vc.delegate = delegate;  
42 - [nav pushViewController:vc animated:YES];  
43 - NSLog(@"------%@------",self.itemId);  
44 -  
45 -}  
46 -  
47 -@end  
Example/CNLiveServices/Home/CNLiveHomeViewController.m
@@ -8,10 +8,8 @@ @@ -8,10 +8,8 @@
8 8
9 #import "CNLiveHomeViewController.h" 9 #import "CNLiveHomeViewController.h"
10 #import "CNLiveServices.h" 10 #import "CNLiveServices.h"
11 -#import "CNLiveFoundServiceProtocol.h"  
12 -#import "CNLiveDetailsViewController.h"  
13 11
14 -@interface CNLiveHomeViewController ()<CNLiveFoundProtocol> 12 +@interface CNLiveHomeViewController ()
15 13
16 @end 14 @end
17 15
@@ -46,20 +44,20 @@ @@ -46,20 +44,20 @@
46 } 44 }
47 45
48 - (void)testButtonClicked { 46 - (void)testButtonClicked {
49 - id<CNLiveLoginServiceProtocol> login = [[BeeHive shareInstance] createService:@protocol(CNLiveLoginServiceProtocol)];  
50 - [login loginIfNeedWithCompleteBlock:^(BOOL succeed) {  
51 - if (succeed) {  
52 - id<CNLiveFoundServiceProtocol> found = [[BeeHive shareInstance] createService:@protocol(CNLiveFoundServiceProtocol)];  
53 - [found pushToFoundViewControllerByName:@"" url:@"" delegate:self];  
54 -  
55 - }  
56 - }]; 47 +// id<CNLiveLoginServiceProtocol> login = [[BeeHive shareInstance] createService:@protocol(CNLiveLoginServiceProtocol)];
  48 +// [login loginIfNeedWithCompleteBlock:^(BOOL succeed) {
  49 +// if (succeed) {
  50 +//// id<CNLiveFoundServiceProtocol> found = [[BeeHive shareInstance] createService:@protocol(CNLiveFoundServiceProtocol)];
  51 +//// [found pushToFoundViewControllerByName:@"" url:@"" delegate:self];
  52 +//
  53 +// }
  54 +// }];
57 55
58 } 56 }
59 57
60 - (void)testButtonClicked1 { 58 - (void)testButtonClicked1 {
61 - id<CNLiveUserAgreementServiceProtocol> agreement = [[BeeHive shareInstance] createService:@protocol(CNLiveUserAgreementServiceProtocol)];  
62 - [[agreement class] jumpToAgreementH5WithType:CNAgreementCancellation]; 59 +// id<CNLiveUserAgreementServiceProtocol> agreement = [[BeeHive shareInstance] createService:@protocol(CNLiveUserAgreementServiceProtocol)];
  60 +// [[agreement class] jumpToAgreementH5WithType:CNAgreementCancellation];
63 61
64 } 62 }
65 63
Example/CNLiveServices/Home/Module/CNLiveHomeService.m
@@ -11,8 +11,8 @@ @@ -11,8 +11,8 @@
11 #import "CNLiveHomeViewController.h" 11 #import "CNLiveHomeViewController.h"
12 #import "CNLiveDetailsViewController.h" 12 #import "CNLiveDetailsViewController.h"
13 13
14 -@BeeHiveService(CNLiveHomeServiceProtocol,CNLiveHomeService)  
15 -@interface CNLiveHomeService ()<CNLiveHomeServiceProtocol> 14 +@BeeHiveService(CNLiveNetHomeServiceProtocol,CNLiveHomeService)
  15 +@interface CNLiveHomeService ()<CNLiveNetHomeServiceProtocol>
16 16
17 @end 17 @end
18 18
Example/CNLiveServices/Login/Controller/CNLoginViewController.h deleted 100644 → 0
1 -//  
2 -// CNLoginViewController.h  
3 -// CNLiveServices_Example  
4 -//  
5 -// Created by CNLive-zxw on 2019/7/22.  
6 -// Copyright © 2019 153993236@qq.com. All rights reserved.  
7 -//  
8 -  
9 -#import <UIKit/UIKit.h>  
10 -typedef void (^CompleteBlock) (BOOL isLogin);  
11 -  
12 -NS_ASSUME_NONNULL_BEGIN  
13 -  
14 -@interface CNLoginViewController : UIViewController  
15 -@property (nonatomic, copy) CompleteBlock completeBlock;  
16 -@property (nonatomic, copy) NSString *name;  
17 -  
18 -@end  
19 -  
20 -NS_ASSUME_NONNULL_END  
Example/CNLiveServices/Login/Controller/CNLoginViewController.m deleted 100644 → 0
1 -//  
2 -// CNLoginViewController.m  
3 -// CNLiveServices_Example  
4 -//  
5 -// Created by CNLive-zxw on 2019/7/22.  
6 -// Copyright © 2019 153993236@qq.com. All rights reserved.  
7 -//  
8 -  
9 -#import "CNLoginViewController.h"  
10 -#import "CNLiveServices.h"  
11 -#import "CNLiveUserInfoManager.h"  
12 -#import "CNLiveUserRequest.h"  
13 -  
14 -@interface CNLoginViewController ()  
15 -  
16 -@end  
17 -  
18 -@implementation CNLoginViewController  
19 -  
20 -- (void)viewWillAppear:(BOOL)animated{  
21 - [super viewWillAppear:animated];  
22 -  
23 -}  
24 -  
25 -- (void)viewWillDisappear:(BOOL)animated{  
26 - [super viewWillDisappear:animated];  
27 -  
28 -}  
29 -  
30 -- (void)viewDidLoad {  
31 - [super viewDidLoad];  
32 - // Do any additional setup after loading the view.  
33 - self.view.backgroundColor = [UIColor whiteColor];  
34 - self.title = @"登录";  
35 -  
36 - UIButton *btn0 = [UIButton buttonWithType:UIButtonTypeCustom];  
37 - btn0.frame = CGRectMake(0, 0, 100, 100);  
38 - btn0.center = CGPointMake(self.view.center.x, self.view.center.y-120);  
39 - btn0.backgroundColor = [UIColor redColor];  
40 - [btn0 setTitle:@"进入协议" forState:UIControlStateNormal];  
41 - [btn0 addTarget:self action:@selector(testButtonClicked0) forControlEvents:UIControlEventTouchUpInside];  
42 - [self.view addSubview:btn0];  
43 -  
44 - UIButton *btn1 = [UIButton buttonWithType:UIButtonTypeCustom];  
45 - btn1.frame = CGRectMake(0, 0, 100, 100);  
46 - btn1.center = self.view.center;  
47 - btn1.backgroundColor = [UIColor redColor];  
48 - [btn1 setTitle:@"登录" forState:UIControlStateNormal];  
49 - [btn1 addTarget:self action:@selector(testButtonClicked1) forControlEvents:UIControlEventTouchUpInside];  
50 - [self.view addSubview:btn1];  
51 -  
52 -}  
53 -  
54 -- (void)testButtonClicked0 {  
55 - id<CNLiveUserAgreementServiceProtocol> agreement = [[BeeHive shareInstance] createService:@protocol(CNLiveUserAgreementServiceProtocol)];  
56 - [[agreement class] jumpToAgreementH5WithType:CNAgreementUser];  
57 -  
58 -}  
59 -  
60 -- (void)testButtonClicked1 {  
61 -  
62 - [CNLiveUserRequest loginWithUserName:nil password:nil fromId:nil success:^(id _Nonnull result) {  
63 -  
64 - } failure:^(NSDictionary * _Nonnull errorDic) {  
65 -  
66 - }];  
67 -  
68 -  
69 -// NSDictionary *dic = @{@"token":@"zxwqwer",@"id":@"123",@"pic":@"http://asdsa",@"name":@"张晓文"};  
70 - NSDictionary *dic = @{@"token":@"zxwqwer",@"id":@"123",@"name":@"张晓文",@"pic":@""};  
71 -  
72 - [[CNLiveUserInfoManager manager] defaultConfiguration:dic];  
73 - [self dismissViewControllerAnimated:YES completion:^{  
74 - self.completeBlock? self.completeBlock(User_Login):@"";  
75 -  
76 - }];  
77 -}  
78 -/*  
79 -#pragma mark - Navigation  
80 -  
81 -// In a storyboard-based application, you will often want to do a little preparation before navigation  
82 -- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {  
83 - // Get the new view controller using [segue destinationViewController].  
84 - // Pass the selected object to the new view controller.  
85 -}  
86 -*/  
87 -  
88 -  
89 -@end  
Example/CNLiveServices/Login/Model/CNLiveUserCenter.h deleted 100644 → 0
1 -//  
2 -// CNLiveUserCenter.h  
3 -// CNLiveServices  
4 -//  
5 -// Created by CNLive-zxw on 2019/9/2.  
6 -// Copyright © 2019 153993236@qq.com. All rights reserved.  
7 -//  
8 -  
9 -#ifndef CNLiveUserCenter_h  
10 -#define CNLiveUserCenter_h  
11 -  
12 -// 枚举值  
13 -#import "CNLiveUserTypeDef.h"  
14 -// 用户相关的请求  
15 -#import "CNLiveUserRequest.h"  
16 -// 本地化用户数据  
17 -#import "CNLiveUserInfoManager.h"  
18 -  
19 -#endif /* CNLiveUserCenter_h */  
Example/CNLiveServices/Login/Model/CNLiveUserInfoManager.h deleted 100644 → 0
1 -//  
2 -// CNLiveUserInfoManager.h  
3 -// CNLiveServices_Example  
4 -//  
5 -// Created by CNLive-zxw on 2019/8/8.  
6 -// Copyright © 2019 153993236@qq.com. All rights reserved.  
7 -//  
8 -  
9 -/**  
10 - * 保存用户信息  
11 - */  
12 -  
13 -#import <Foundation/Foundation.h>  
14 -#import "CNLiveUserTypeDef.h"  
15 -  
16 -NS_ASSUME_NONNULL_BEGIN  
17 -// Token  
18 -#define User_Token [CNLiveUserInfoManager manager].token?[CNLiveUserInfoManager manager].token:@""  
19 -// 用户id  
20 -#define User_ID [CNLiveUserInfoManager manager].ID?[CNLiveUserInfoManager manager].ID:@""  
21 -// 用户手机号  
22 -#define User_Tel [CNLiveUserInfoManager manager].tel?[CNLiveUserInfoManager manager].tel:@""  
23 -// 用户名字  
24 -#define User_Name [CNLiveUserInfoManager manager].name?[CNLiveUserInfoManager manager].name:@""  
25 -// 用户性别  
26 -#define User_Sex [CNLiveUserInfoManager manager].sex?[CNLiveUserInfoManager manager].sex:@""  
27 -// 默认头像  
28 -#define Default_Head @"默认头像"  
29 -// 用户头像  
30 -#define User_Head [CNLiveUserInfoManager manager].pic?[CNLiveUserInfoManager manager].pic:Default_Head  
31 -// 用户简介  
32 -#define User_Introduction [CNLiveUserInfoManager manager].introduction?[CNLiveUserInfoManager manager].introduction:@""  
33 -// 用户是否登录  
34 -#define User_Login [CNLiveUserInfoManager manager].isLogin  
35 -  
36 -@interface CNLiveUserInfoManager : NSObject  
37 -  
38 -@property (nonatomic, copy, readonly) NSString * __nullable token;  
39 -@property (nonatomic, copy, readonly) NSString * __nullable ID;  
40 -@property (nonatomic, copy, readonly) NSString * __nullable name;  
41 -@property (nonatomic, copy, readonly) NSString * __nullable tel;  
42 -@property (nonatomic, copy, readonly) NSString * __nullable pic;  
43 -@property (nonatomic, copy, readonly) NSString * __nullable sex;  
44 -@property (nonatomic, copy, readonly) NSString * __nullable introduction;  
45 -@property (nonatomic, assign, readonly) BOOL isLogin;  
46 -  
47 -+ (instancetype)manager;  
48 -  
49 -/**  
50 - * 配置用户信息  
51 - *  
52 - * dic 用户信息字典  
53 - */  
54 -- (void)defaultConfiguration:(NSDictionary *)dic;  
55 -  
56 -/**  
57 - * 更新用户信息  
58 - */  
59 -- (void)updateUserInfo:(CNLiveUserInfoType)type info:(NSString *)info;  
60 -  
61 -/**  
62 - * 退出登录,删除用户信息  
63 - */  
64 -- (void)removeUserInfo;  
65 -  
66 -@end  
67 -  
68 -NS_ASSUME_NONNULL_END  
Example/CNLiveServices/Login/Model/CNLiveUserInfoManager.m deleted 100644 → 0
1 -//  
2 -// CNLiveUserInfoManager.m  
3 -// CNLiveServices_Example  
4 -//  
5 -// Created by CNLive-zxw on 2019/8/8.  
6 -// Copyright © 2019 153993236@qq.com. All rights reserved.  
7 -//  
8 -  
9 -#import "CNLiveUserInfoManager.h"  
10 -#import "MJExtension.h"  
11 -#import "CNLiveUserInfoModel.h"  
12 -  
13 -@interface CNLiveUserInfoManager()  
14 -@property (nonatomic, copy, readwrite) NSString * __nullable token;  
15 -@property (nonatomic, copy, readwrite) NSString * __nullable ID;  
16 -@property (nonatomic, copy, readwrite) NSString * __nullable tel;  
17 -@property (nonatomic, copy, readwrite) NSString * __nullable name;  
18 -@property (nonatomic, copy, readwrite) NSString * __nullable pic;  
19 -@property (nonatomic, copy, readwrite) NSString * __nullable sex;  
20 -@property (nonatomic, copy, readwrite) NSString * __nullable introduction;  
21 -  
22 -@property (nonatomic, strong) CNLiveUserInfoModel * __nullable model;  
23 -@end  
24 -  
25 -@implementation CNLiveUserInfoManager  
26 -NSString * const CNLiveUserInfo = @"CNLiveUserInfo";  
27 -  
28 -static CNLiveUserInfoManager *_instance = nil;  
29 -  
30 -/**  
31 - * @abstract 单例初始化  
32 - */  
33 -+ (instancetype)manager{  
34 - static dispatch_once_t once;  
35 - dispatch_once(&once, ^{  
36 - _instance = [[CNLiveUserInfoManager alloc]init];  
37 - });  
38 - return _instance;  
39 -}  
40 -  
41 -+ (id)allocWithZone:(struct _NSZone *)zone{  
42 - static dispatch_once_t onceToken;  
43 - dispatch_once(&onceToken, ^{  
44 - _instance = [super allocWithZone:zone];  
45 - });  
46 - return _instance;  
47 -}  
48 -  
49 -- (nonnull id)copyWithZone:(nullable NSZone *)zone {  
50 - return _instance;  
51 -}  
52 -  
53 -- (nonnull id)mutableCopyWithZone:(nullable NSZone *)zone {  
54 - return _instance;  
55 -}  
56 -- (instancetype)init{  
57 - if (self = [super init]) {  
58 - NSDictionary *dic = [[NSUserDefaults standardUserDefaults] objectForKey:CNLiveUserInfo];  
59 - if (dic != nil) {  
60 - [self defaultConfiguration:dic];  
61 - }  
62 - }  
63 - return self;  
64 -}  
65 -  
66 -/**  
67 - * 用户是否登录成功  
68 - */  
69 -- (BOOL)isLogin{  
70 - if(self.ID && ![self.ID isEqualToString:@""] && self.name && ![self.name isEqualToString:@""] && self.token && ![self.token isEqualToString:@""]){  
71 - return YES;  
72 - }  
73 - return NO;  
74 -}  
75 -  
76 -/**  
77 - * 配置用户信息  
78 - *  
79 - * dic 用户信息字典  
80 - */  
81 -- (void)defaultConfiguration:(NSDictionary *)dic {  
82 - [[NSUserDefaults standardUserDefaults] setObject:dic forKey:CNLiveUserInfo];  
83 - [[NSUserDefaults standardUserDefaults] synchronize];  
84 -  
85 - CNLiveUserInfoModel *model = [CNLiveUserInfoModel mj_objectWithKeyValues:dic];  
86 - self.model = model;  
87 - self.token = model.token;  
88 - self.ID = model.ID;  
89 - self.name = model.name;  
90 - self.pic = model.pic;  
91 -}  
92 -  
93 -/**  
94 - * 更新用户信息  
95 - */  
96 -- (void)updateUserInfo:(CNLiveUserInfoType)type info:(NSString *)info{  
97 - NSMutableDictionary *dic = [[NSUserDefaults standardUserDefaults] objectForKey:CNLiveUserInfo];  
98 - if (dic != nil) {  
99 - switch (type) {  
100 - case CNLiveUserInfoTypeTel:  
101 - {  
102 - dic[@"tel"] = info;  
103 - _instance.tel = info;  
104 - _instance.model.tel = info;  
105 -  
106 - }  
107 - break;  
108 - case CNLiveUserInfoTypeName:  
109 - {  
110 - dic[@"name"] = info;  
111 - _instance.name = info;  
112 - _instance.model.name = info;  
113 -  
114 - }  
115 - break;  
116 - case CNLiveUserInfoTypeHead:  
117 - {  
118 - dic[@"pic"] = info;  
119 - _instance.pic = info;  
120 - _instance.model.pic = info;  
121 -  
122 - }  
123 - break;  
124 - case CNLiveUserInfoTypeSex:  
125 - {  
126 - dic[@"sex"] = info;  
127 - _instance.sex = info;  
128 - _instance.model.sex = info;  
129 -  
130 - }  
131 - break;  
132 - case CNLiveUserInfoTypeIntroduction:  
133 - {  
134 - dic[@"introduction"] = info;  
135 - _instance.introduction = info;  
136 - _instance.model.introduction = info;  
137 -  
138 - }  
139 - break;  
140 - }  
141 - [[NSUserDefaults standardUserDefaults] setObject:dic forKey:CNLiveUserInfo];  
142 - [[NSUserDefaults standardUserDefaults] synchronize];  
143 - }  
144 -}  
145 -  
146 -/**  
147 - * 退出登录,删除用户信息  
148 - */  
149 -- (void)removeUserInfo{  
150 - [[NSUserDefaults standardUserDefaults] setObject:nil forKey:CNLiveUserInfo];  
151 - [[NSUserDefaults standardUserDefaults] synchronize];  
152 -  
153 - self.model = nil;  
154 - self.token = nil;  
155 - self.ID = nil;  
156 - self.name = nil;  
157 - self.pic = nil;  
158 - self.sex = nil;  
159 - self.introduction = nil;  
160 -  
161 -}  
162 -  
163 -  
164 -@end  
Example/CNLiveServices/Login/Model/CNLiveUserInfoModel.h deleted 100644 → 0
1 -//  
2 -// CNLiveUserInfoModel.h  
3 -// CNLiveServices_Example  
4 -//  
5 -// Created by CNLive-zxw on 2019/9/2.  
6 -// Copyright © 2019 153993236@qq.com. All rights reserved.  
7 -//  
8 -  
9 -#import <Foundation/Foundation.h>  
10 -  
11 -NS_ASSUME_NONNULL_BEGIN  
12 -  
13 -@interface CNLiveUserInfoModel : NSObject  
14 -@property (nonatomic, copy) NSString *token;  
15 -@property (nonatomic, copy) NSString *ID;  
16 -@property (nonatomic, copy) NSString *tel;  
17 -@property (nonatomic, copy) NSString *name;  
18 -@property (nonatomic, copy) NSString *pic;  
19 -@property (nonatomic, copy) NSString *sex;  
20 -@property (nonatomic, copy) NSString *introduction;  
21 -  
22 -@end  
23 -  
24 -NS_ASSUME_NONNULL_END  
Example/CNLiveServices/Login/Model/CNLiveUserInfoModel.m deleted 100644 → 0
1 -//  
2 -// CNLiveUserInfoModel.m  
3 -// CNLiveServices_Example  
4 -//  
5 -// Created by CNLive-zxw on 2019/9/2.  
6 -// Copyright © 2019 153993236@qq.com. All rights reserved.  
7 -//  
8 -  
9 -#import "CNLiveUserInfoModel.h"  
10 -  
11 -@implementation CNLiveUserInfoModel  
12 -  
13 -+ (NSDictionary *)mj_replacedKeyFromPropertyName {  
14 - return @{@"ID":@"id"};  
15 -}  
16 -  
17 -@end  
Example/CNLiveServices/Login/Model/CNLiveUserRequest.h deleted 100644 → 0
1 -//  
2 -// CNLiveUserRequest.h  
3 -// CNLiveServices_Example  
4 -//  
5 -// Created by CNLive-zxw on 2019/9/2.  
6 -// Copyright © 2019 153993236@qq.com. All rights reserved.  
7 -//  
8 -  
9 -#import <Foundation/Foundation.h>  
10 -#import "CNLiveUserTypeDef.h"  
11 -  
12 -NS_ASSUME_NONNULL_BEGIN  
13 -  
14 -@interface CNLiveUserRequest : NSObject  
15 -  
16 -/**  
17 - @abstract 初始化  
18 - @param appId 注册成功获得应用ID  
19 - @param appKey 注册成功获得应用key  
20 - @param appSecret 注册成功获得应用secret  
21 - @param isTestEnvironment 测试环境开关  
22 - @warning 必传参数  
23 - 必须在 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions; 方法中调用  
24 - */  
25 -+ (void)setAppId:(NSString *)appId appKey:(NSString *)appKey appSecret:(NSString *)appSecret isTestEnvironment:(BOOL)isTestEnvironment;  
26 -  
27 -  
28 -/**  
29 - @abstract 发送验证码  
30 - @param type 发送验证码类型(详见CodeType)  
31 - @param mobile 手机号  
32 - @param success 成功回调  
33 - @param failure 失败回调  
34 - */  
35 -+ (void)verificationCodeType:(CNLiveCodeType)type mobile:(NSString *)mobile success:(void (^)(id result))success failure:(void (^)(NSDictionary *errorDic))failure;  
36 -  
37 -  
38 -/**  
39 - @abstract 注册  
40 - @param userName 邮箱或手机  
41 - @param password 密码  
42 - @param verificationCode 手机验证码(手机号注册时必填)  
43 - @param invitationCode 邀请码(非必填)  
44 - @param fromId 渠道ID(非必填)  
45 - @param success 成功回调  
46 - @param failure 失败回调  
47 - */  
48 -+ (void)registerWithUserName:(NSString *)userName password:(NSString *)password verificationCode:(NSString *)verificationCode invitationCode:(NSString * _Nullable)invitationCode fromId:(NSString * _Nullable)fromId success:(void (^)(id result))success failure:(void (^)(NSDictionary *errorDic))failure;  
49 -  
50 -  
51 -/**  
52 - @abstract 快捷登录  
53 - @param userName 手机号  
54 - @param verificationCode 验证码  
55 - @param fromId 渠道ID(非必填)  
56 - @param success 成功回调  
57 - @param failure 失败回调  
58 - */  
59 -+ (void)shortcutLoginWithUserName:(NSString *)userName verificationCode:(NSString *)verificationCode fromId:(NSString * _Nullable)fromId success:(void (^)(id))success failure :(void (^)(NSDictionary *))failure;  
60 -  
61 -  
62 -/**  
63 - @abstract 登录  
64 - @param userName 手机号或邮箱  
65 - @param password 密码  
66 - @param fromId 渠道ID(非必填)  
67 - @param success 成功回调  
68 - @param failure 失败回调  
69 - */  
70 -+ (void)loginWithUserName:(NSString *)userName password:(NSString *)password fromId:(NSString * _Nullable)fromId success:(void (^)(id result))success failure:(void (^)(NSDictionary *errorDic))failure;  
71 -  
72 -  
73 -/**  
74 - @abstract 修改用户单项信息  
75 - @param type 修改类型(name-昵称, sex-性别, tel-手机号, head-头像, introduction-简介)  
76 - @param uid 用户ID  
77 - @param info 对应的信息(注sex对应f/m/n)  
78 - @param success 成功回调  
79 - @param failure 失败回调  
80 - */  
81 -+ (void)updateUserInfoType:(CNLiveUserInfoType)type uid:(NSString *)uid info:(NSString *)info success:(void (^)(id result))success failure:(void (^)(NSDictionary *errorDic))failure;  
82 -  
83 -  
84 -@end  
85 -  
86 -NS_ASSUME_NONNULL_END  
Example/CNLiveServices/Login/Model/CNLiveUserRequest.m deleted 100644 → 0
1 -//  
2 -// CNLiveUserRequest.m  
3 -// CNLiveServices_Example  
4 -//  
5 -// Created by CNLive-zxw on 2019/9/2.  
6 -// Copyright © 2019 153993236@qq.com. All rights reserved.  
7 -//  
8 -  
9 -#import "CNLiveUserRequest.h"  
10 -#import "CNLiveUserUrl.h"  
11 -  
12 -#define User_AppId [CNLiveUserRequest manager].appId?[CNLiveUserRequest manager].appId:@""  
13 -#define User_AppKey [CNLiveUserRequest manager].appKey?[CNLiveUserRequest manager].appKey:@""  
14 -#define User_AppSecret [CNLiveUserRequest manager].appSecret?[CNLiveUserRequest manager].appSecret:@""  
15 -#define User_TestEnvironment [CNLiveUserRequest manager].isTestEnvironment  
16 -  
17 -@interface CNLiveUserRequest()  
18 -  
19 -@property (nonatomic, copy) NSString *appId;  
20 -@property (nonatomic, copy) NSString *appKey;  
21 -@property (nonatomic, copy) NSString *appSecret;  
22 -@property (nonatomic, assign) BOOL isTestEnvironment;  
23 -  
24 -@end  
25 -  
26 -@implementation CNLiveUserRequest  
27 -static CNLiveUserRequest *_instance = nil;  
28 -  
29 -/**  
30 - * @abstract 单例初始化  
31 - */  
32 -+ (instancetype)manager{  
33 - static dispatch_once_t once;  
34 - dispatch_once(&once, ^{  
35 - _instance = [[CNLiveUserRequest alloc]init];  
36 - });  
37 - return _instance;  
38 -}  
39 -  
40 -+ (id)allocWithZone:(struct _NSZone *)zone{  
41 - static dispatch_once_t onceToken;  
42 - dispatch_once(&onceToken, ^{  
43 - _instance = [super allocWithZone:zone];  
44 - });  
45 - return _instance;  
46 -}  
47 -  
48 -- (nonnull id)copyWithZone:(nullable NSZone *)zone {  
49 - return _instance;  
50 -}  
51 -  
52 -- (nonnull id)mutableCopyWithZone:(nullable NSZone *)zone {  
53 - return _instance;  
54 -}  
55 -  
56 -/**  
57 - @abstract 初始化  
58 - @param appId 注册成功获得应用ID  
59 - @param appKey 注册成功获得应用key  
60 - @param appSecret 注册成功获得应用secret  
61 - @param isTestEnvironment 测试环境开关  
62 - @warning 必传参数  
63 - 必须在 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions; 方法中调用  
64 - */  
65 -+ (void)setAppId:(NSString *)appId appKey:(NSString *)appKey appSecret:(NSString *)appSecret isTestEnvironment:(BOOL)isTestEnvironment{  
66 - CNLiveUserRequest *manager = [CNLiveUserRequest manager];  
67 - manager.appId = appId;  
68 - manager.appKey = appKey;  
69 - manager.appSecret = appSecret;  
70 - manager.isTestEnvironment = isTestEnvironment;  
71 -  
72 -}  
73 -  
74 -  
75 -/**  
76 - @abstract 发送验证码  
77 - @param type 发送验证码类型(详见CodeType)  
78 - @param mobile 手机号  
79 - @param success 成功回调  
80 - @param failure 失败回调  
81 - */  
82 -+ (void)verificationCodeType:(CNLiveCodeType)type mobile:(NSString *)mobile success:(void (^)(id result))success failure:(void (^)(NSDictionary *errorDic))failure{  
83 - NSString *url = (User_TestEnvironment)?CNLive_User_Code_Test:CNLive_User_Code;  
84 -  
85 -}  
86 -  
87 -  
88 -/**  
89 - @abstract 注册  
90 - @param userName 邮箱或手机  
91 - @param password 密码  
92 - @param verificationCode 手机验证码(手机号注册时必填)  
93 - @param invitationCode 邀请码(非必填)  
94 - @param fromId 渠道ID(非必填)  
95 - @param success 成功回调  
96 - @param failure 失败回调  
97 - */  
98 -+ (void)registerWithUserName:(NSString *)userName password:(NSString *)password verificationCode:(NSString *)verificationCode invitationCode:(NSString * _Nullable)invitationCode fromId:(NSString * _Nullable)fromId success:(void (^)(id result))success failure:(void (^)(NSDictionary *errorDic))failure{  
99 - NSString *url = (User_TestEnvironment)?CNLive_User_Register_Test:CNLive_User_Register;  
100 -  
101 -}  
102 -  
103 -  
104 -/**  
105 - @abstract 快捷登录  
106 - @param userName 手机号  
107 - @param verificationCode 验证码  
108 - @param fromId 渠道ID(非必填)  
109 - @param success 成功回调  
110 - @param failure 失败回调  
111 - */  
112 -+ (void)shortcutLoginWithUserName:(NSString *)userName verificationCode:(NSString *)verificationCode fromId:(NSString * _Nullable)fromId success:(void (^)(id))success failure :(void (^)(NSDictionary *))failure{  
113 - NSString *url = (User_TestEnvironment)?CNLive_User_SLogin_Test:CNLive_User_SLogin;  
114 -  
115 -}  
116 -  
117 -  
118 -/**  
119 - @abstract 登录  
120 - @param userName 手机号或邮箱  
121 - @param password 密码  
122 - @param fromId 渠道ID(非必填)  
123 - @param success 成功回调  
124 - @param failure 失败回调  
125 - */  
126 -+ (void)loginWithUserName:(NSString *)userName password:(NSString *)password fromId:(NSString * _Nullable)fromId success:(void (^)(id result))success failure:(void (^)(NSDictionary *errorDic))failure{  
127 - NSString *url = (User_TestEnvironment)?CNLive_User_Login_Test:CNLive_User_Login;  
128 -  
129 -}  
130 -  
131 -  
132 -/**  
133 - @abstract 修改用户单项信息  
134 - @param type 修改类型(name-昵称, sex-性别, tel-手机号, head-头像, introduction-简介)  
135 - @param uid 用户ID  
136 - @param info 对应的信息(注sex对应f/m/n)  
137 - @param success 成功回调  
138 - @param failure 失败回调  
139 - */  
140 -+ (void)updateUserInfoType:(CNLiveUserInfoType)type uid:(NSString *)uid info:(NSString *)info success:(void (^)(id result))success failure:(void (^)(NSDictionary *errorDic))failure {  
141 - NSString *url = (User_TestEnvironment)?CNLive_User_Update_Test:CNLive_User_Update;  
142 -  
143 -}  
144 -  
145 -@end  
Example/CNLiveServices/Login/Model/CNLiveUserTypeDef.h deleted 100644 → 0
1 -//  
2 -// CNLiveUserTypeDef.h  
3 -// CNLiveServices_Example  
4 -//  
5 -// Created by CNLive-zxw on 2019/8/8.  
6 -// Copyright © 2019 153993236@qq.com. All rights reserved.  
7 -//  
8 -  
9 -#ifndef CNLiveUserTypeDef_h  
10 -#define CNLiveUserTypeDef_h  
11 -  
12 -// 获取验证码  
13 -typedef NS_ENUM(NSUInteger, CNLiveCodeType) {  
14 - CNLiveCodeTypeShortcutLogin = 0, //快捷登录  
15 - CNLiveCodeTypeRegister, //注册  
16 - CNLiveCodeTypeUpdateTel, //修改手机号  
17 - CNLiveCodeTypeRetrievePassword //找回或修改密码  
18 -};  
19 -  
20 -  
21 -// 修改单项用户信息类型  
22 -typedef NS_ENUM(NSUInteger, CNLiveUserInfoType) {  
23 - CNLiveUserInfoTypeTel = 0, //手机号  
24 - CNLiveUserInfoTypeName, //昵称  
25 - CNLiveUserInfoTypeHead, //头像  
26 - CNLiveUserInfoTypeSex, //性别  
27 - CNLiveUserInfoTypeIntroduction //简介  
28 -  
29 -};  
30 -  
31 -#endif /* CNLiveUserTypeDef_h */  
Example/CNLiveServices/Login/Model/CNLiveUserUrl.h deleted 100644 → 0
1 -//  
2 -// CNLiveUserUrl.h  
3 -// CNLiveServices_Example  
4 -//  
5 -// Created by CNLive-zxw on 2019/9/2.  
6 -// Copyright © 2019 153993236@qq.com. All rights reserved.  
7 -//  
8 -  
9 -#ifndef CNLiveUserUrl_h  
10 -#define CNLiveUserUrl_h  
11 -  
12 -// 获取验证码  
13 -#define CNLive_User_Code @""  
14 -#define CNLive_User_Code_Test @""  
15 -  
16 -// 登录  
17 -#define CNLive_User_Register @""  
18 -#define CNLive_User_Register_Test @""  
19 -  
20 -// 快捷登录  
21 -#define CNLive_User_SLogin @""  
22 -#define CNLive_User_SLogin_Test @""  
23 -  
24 -// 登录  
25 -#define CNLive_User_Login @""  
26 -#define CNLive_User_Login_Test @""  
27 -  
28 -// 更新  
29 -#define CNLive_User_Update @""  
30 -#define CNLive_User_Update_Test @""  
31 -  
32 -  
33 -#endif /* CNLiveUserUrl_h */  
Example/CNLiveServices/Login/Module/CNLiveLoginModule.h deleted 100644 → 0
1 -//  
2 -// CNLiveLoginModule.h  
3 -// CNLiveServices_Example  
4 -//  
5 -// Created by CNLive-zxw on 2019/7/22.  
6 -// Copyright © 2019 153993236@qq.com. All rights reserved.  
7 -//  
8 -  
9 -#import <Foundation/Foundation.h>  
10 -  
11 -NS_ASSUME_NONNULL_BEGIN  
12 -  
13 -@interface CNLiveLoginModule : NSObject  
14 -  
15 -@end  
16 -  
17 -NS_ASSUME_NONNULL_END  
Example/CNLiveServices/Login/Module/CNLiveLoginModule.m deleted 100644 → 0
1 -//  
2 -// CNLiveLoginModule.m  
3 -// CNLiveServices_Example  
4 -//  
5 -// Created by CNLive-zxw on 2019/7/22.  
6 -// Copyright © 2019 153993236@qq.com. All rights reserved.  
7 -//  
8 -  
9 -#import "CNLiveLoginModule.h"  
10 -#import "BeeHive.h"  
11 -  
12 -@BeeHiveMod(CNLiveLoginModule)  
13 -@interface CNLiveLoginModule()<BHModuleProtocol>  
14 -  
15 -@end  
16 -@implementation CNLiveLoginModule  
17 -- (id)init {  
18 - if (self = [super init]) {  
19 -  
20 - }  
21 - return self;  
22 -  
23 -}  
24 -  
25 -- (NSUInteger)moduleLevel {  
26 - return 0;  
27 -  
28 -}  
29 -  
30 -- (void)modSetUp:(BHContext *)context {  
31 -// NSLog(@"CNLiveLoginModule setup");  
32 - switch (context.env) {  
33 - case BHEnvironmentDev:  
34 - //....初始化开发环境  
35 - break;  
36 - case BHEnvironmentProd:  
37 - //....初始化生产环境  
38 - default:  
39 - break;  
40 - }  
41 -  
42 -}  
43 -  
44 -- (void)modInit:(BHContext *)context {  
45 -// NSLog(@"CNLiveLoginModule init");  
46 -  
47 -}  
48 -  
49 -@end  
Example/CNLiveServices/Login/Module/CNLiveLoginService.h deleted 100644 → 0
1 -//  
2 -// CNLiveLoginService.h  
3 -// CNLiveServices_Example  
4 -//  
5 -// Created by CNLive-zxw on 2019/7/22.  
6 -// Copyright © 2019 153993236@qq.com. All rights reserved.  
7 -//  
8 -  
9 -#import <Foundation/Foundation.h>  
10 -  
11 -NS_ASSUME_NONNULL_BEGIN  
12 -  
13 -@interface CNLiveLoginService : NSObject  
14 -  
15 -@end  
16 -  
17 -NS_ASSUME_NONNULL_END  
Example/CNLiveServices/Login/Module/CNLiveLoginService.m deleted 100644 → 0
1 -//  
2 -// CNLiveLoginService.m  
3 -// CNLiveServices_Example  
4 -//  
5 -// Created by CNLive-zxw on 2019/7/22.  
6 -// Copyright © 2019 153993236@qq.com. All rights reserved.  
7 -//  
8 -  
9 -#import "CNLiveLoginService.h"  
10 -#import "CNLiveServices.h"  
11 -#import "CNLoginViewController.h"  
12 -#import "CNLiveUserInfoManager.h"  
13 -  
14 -@BeeHiveService(CNLiveLoginServiceProtocol,CNLiveLoginService)  
15 -@interface CNLiveLoginService ()<CNLiveLoginServiceProtocol>  
16 -  
17 -@end  
18 -  
19 -@implementation CNLiveLoginService  
20 -@synthesize itemId = _itemId;  
21 -  
22 -- (UIViewController *)getLoginViewController{  
23 - return [CNLoginViewController new];  
24 -  
25 -}  
26 -  
27 -- (void)pushToLoginViewController{  
28 - UINavigationController *nav = (UINavigationController *)[UIApplication sharedApplication].delegate.window.rootViewController;  
29 - CNLoginViewController *vc = [CNLoginViewController new];  
30 - [nav pushViewController:vc animated:YES];  
31 -  
32 -}  
33 -  
34 -- (void)loginIfNeedWithCompleteBlock:(void (^)(BOOL))completeBlock{  
35 - if ([CNLiveUserInfoManager manager].isLogin) {  
36 - completeBlock(YES);  
37 -  
38 - }  
39 - else{  
40 - CNLoginViewController *login = [CNLoginViewController new];  
41 - login.completeBlock = completeBlock;  
42 - UIViewController *root = [UIApplication sharedApplication].delegate.window.rootViewController;  
43 - [root presentViewController:login animated:YES completion:nil];  
44 - }  
45 -  
46 -}  
47 -  
48 -  
49 -@end  
Example/CNLiveServices/UserAgreement/CNUserAgreementManager.h deleted 100644 → 0
1 -//  
2 -// CNUserAgreementManager.h  
3 -// Test  
4 -//  
5 -// Created by CNLive-zxw on 2019/4/13.  
6 -// Copyright © 2019 CNLive. All rights reserved.  
7 -//  
8 -  
9 -#import <Foundation/Foundation.h>  
10 -#import "CNLiveServices.h"  
11 -  
12 -NS_ASSUME_NONNULL_BEGIN  
13 -  
14 -@interface CNUserAgreementManager : NSObject  
15 -  
16 -+ (instancetype)manager;  
17 -  
18 -+ (void)jumpToAgreementH5WithType:(CNGetAgreementH5Type)type;  
19 -  
20 -+ (void)getAgreementH5WithType:(CNGetAgreementH5Type)type success:(SuccessBlock)success failure:(FailureBlock)failure;  
21 -  
22 -- (void)getAgreementH5WithType:(CNGetAgreementH5Type)type success:(SuccessBlock)success failure:(FailureBlock)failure;  
23 -  
24 -@end  
25 -  
26 -NS_ASSUME_NONNULL_END  
Example/CNLiveServices/UserAgreement/CNUserAgreementManager.m deleted 100644 → 0
1 -//  
2 -// CNUserAgreementManager.m  
3 -// Test  
4 -//  
5 -// Created by CNLive-zxw on 2019/4/13.  
6 -// Copyright © 2019 CNLive. All rights reserved.  
7 -//  
8 -  
9 -#import "CNUserAgreementManager.h"  
10 -#import "CNUserAgreementWebController.h"  
11 -#import "CNLiveNetworking.h"  
12 -#import "CNLiveEnvironment.h"  
13 -  
14 -@BeeHiveService(CNLiveUserAgreementServiceProtocol,CNUserAgreementManager)  
15 -@interface CNUserAgreementManager ()<CNLiveUserAgreementServiceProtocol>  
16 -  
17 -@end  
18 -  
19 -@implementation CNUserAgreementManager  
20 -  
21 -static CNUserAgreementManager *_instance = nil;  
22 -  
23 -/**  
24 - * @abstract 单例初始化  
25 - */  
26 -+ (instancetype)manager{  
27 - static dispatch_once_t once;  
28 - dispatch_once(&once, ^{  
29 - _instance = [[CNUserAgreementManager alloc]init];  
30 - });  
31 - return _instance;  
32 -}  
33 -  
34 -+ (id)allocWithZone:(struct _NSZone *)zone{  
35 - static dispatch_once_t onceToken;  
36 - dispatch_once(&onceToken, ^{  
37 - _instance = [super allocWithZone:zone];  
38 - });  
39 - return _instance;  
40 -}  
41 -  
42 -- (nonnull id)copyWithZone:(nullable NSZone *)zone {  
43 - return _instance;  
44 -}  
45 -  
46 -- (nonnull id)mutableCopyWithZone:(nullable NSZone *)zone {  
47 - return _instance;  
48 -}  
49 -  
50 -+ (void)jumpToAgreementH5WithType:(CNGetAgreementH5Type)type {  
51 - [CNUserAgreementManager getAgreementH5WithType:type success:^(NSString *h5, NSString *title) {  
52 - UIViewController *root = [UIApplication sharedApplication].delegate.window.rootViewController;  
53 -  
54 - //跟控制器是Navigation  
55 - if ([root isKindOfClass:[UINavigationController class]]){  
56 - UINavigationController *nav = (UINavigationController *)root;  
57 - CNUserAgreementWebController *vc = [[CNUserAgreementWebController alloc] initWithUrl:h5 name:title];  
58 - [nav pushViewController:vc animated:YES];  
59 -  
60 - }  
61 - //跟控制器是TabBar  
62 - else if ([root isKindOfClass:[UITabBarController class]]){  
63 - UITabBarController *tab = (UITabBarController *)root;  
64 - UINavigationController *nav = tab.selectedViewController;  
65 - CNUserAgreementWebController *vc = [[CNUserAgreementWebController alloc] initWithUrl:h5 name:title];  
66 - [nav pushViewController:vc animated:YES];  
67 -  
68 - }else{  
69 - CNUserAgreementWebController *vc = [[CNUserAgreementWebController alloc] initWithUrl:h5 name:title];  
70 - [root presentViewController:vc animated:YES completion:nil];  
71 - }  
72 -  
73 - } failure:^(NSError *error) {  
74 -  
75 - }];  
76 -  
77 -}  
78 -  
79 -+ (void)getAgreementH5WithType:(CNGetAgreementH5Type)type success:(SuccessBlock)success failure:(FailureBlock)failure {  
80 - [[CNUserAgreementManager manager] getAgreementH5WithType:type success:^(NSString * _Nonnull h5, NSString * _Nonnull title) {  
81 - success(h5, title);  
82 -  
83 - } failure:^(NSError * _Nonnull error) {  
84 - failure(error);  
85 -  
86 - }];  
87 -  
88 -}  
89 -  
90 -- (void)getAgreementH5WithType:(CNGetAgreementH5Type)type success:(SuccessBlock)success failure:(FailureBlock)failure {  
91 - [CNLiveNetworking setAllowRequestDefaultArgument:NO];  
92 - [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodGET URLString:CNGetAgreementH5Url Param:@{} CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) {  
93 - if (error) {  
94 - if (failure) {  
95 - failure(error);  
96 - }  
97 - }  
98 - else{  
99 - if ([responseObject isKindOfClass:[NSArray class]]) {  
100 -  
101 - for (NSDictionary *dic in responseObject) {  
102 -  
103 - switch (type) {  
104 - case CNAgreementUser:  
105 - {  
106 - if ([[NSString stringWithFormat:@"%@",dic[@"type"]] isEqualToString:@"yhxy"]) {  
107 - if (success) {  
108 - success(dic[@"detailUrl"],dic[@"title"]);  
109 - return ;  
110 - }  
111 - }  
112 - }  
113 - break;  
114 - case CNAgreementPrivacy:  
115 - {  
116 - if ([[NSString stringWithFormat:@"%@",dic[@"type"]] isEqualToString:@"yszc"]) {  
117 - if (success) {  
118 - success(dic[@"detailUrl"],dic[@"title"]);  
119 - return ;  
120 - }  
121 - }  
122 - }  
123 - break;  
124 - case CNAgreementHelp:  
125 - {  
126 - if ([[NSString stringWithFormat:@"%@",dic[@"type"]] isEqualToString:@"bzfk"]) {  
127 - if (success) {  
128 - success(dic[@"detailUrl"],dic[@"title"]);  
129 - return ;  
130 - }  
131 - }  
132 - }  
133 - break;  
134 - case CNAgreementUnderstand:  
135 - {  
136 - if ([[NSString stringWithFormat:@"%@",dic[@"type"]] isEqualToString:@"ljwjj"]) {  
137 - if (success) {  
138 - success(dic[@"detailUrl"],dic[@"title"]);  
139 - return ;  
140 - }  
141 - }  
142 - }  
143 - break;  
144 - case CNAgreementIntroduction:  
145 - {  
146 - if ([[NSString stringWithFormat:@"%@",dic[@"type"]] isEqualToString:@"yyjj"]) {  
147 - if (success) {  
148 - success(dic[@"detailUrl"],dic[@"title"]);  
149 - return ;  
150 - }  
151 - }  
152 - }  
153 - break;  
154 - case CNAgreementCopyright:  
155 - {  
156 - if ([[NSString stringWithFormat:@"%@",dic[@"type"]] isEqualToString:@"bqxx"]) {  
157 - if (success) {  
158 - success(dic[@"detailUrl"],dic[@"title"]);  
159 - return ;  
160 - }  
161 - }  
162 - }  
163 - break;  
164 - case CNAgreementPermission:  
165 - {  
166 - if ([[NSString stringWithFormat:@"%@",dic[@"type"]] isEqualToString:@"rjxkxy"]) {  
167 - if (success) {  
168 - success(dic[@"detailUrl"],dic[@"title"]);  
169 - return ;  
170 - }  
171 - }  
172 - }  
173 - break;  
174 - case CNAgreementIntegralRules:  
175 - {  
176 - if ([[NSString stringWithFormat:@"%@",dic[@"type"]] isEqualToString:@"jfgz"]) {  
177 - if (success) {  
178 - success(dic[@"detailUrl"],dic[@"title"]);  
179 - return ;  
180 - }  
181 - }  
182 - }  
183 - break;  
184 - case CNAgreementSigninRules:  
185 - {  
186 - if ([[NSString stringWithFormat:@"%@",dic[@"type"]] isEqualToString:@"jfjlgz"]) {  
187 - if (success) {  
188 - success(dic[@"detailUrl"],dic[@"title"]);  
189 - return ;  
190 - }  
191 - }  
192 - }  
193 - break;  
194 - case CNAgreementReviewApply:  
195 - {  
196 - if ([[NSString stringWithFormat:@"%@",dic[@"type"]] isEqualToString:@"shsqxy"]) {  
197 - if (success) {  
198 - success(dic[@"detailUrl"],dic[@"title"]);  
199 - return ;  
200 - }  
201 - }  
202 - }  
203 - break;  
204 - case CNAgreementCancellation:  
205 - {  
206 - if ([[NSString stringWithFormat:@"%@",dic[@"type"]] isEqualToString:@"zxxz"]) {  
207 - if (success) {  
208 - success(dic[@"detailUrl"],dic[@"title"]);  
209 - return ;  
210 - }  
211 - }  
212 - }  
213 - break;  
214 - case CNAgreementEmojiService:  
215 - {  
216 - if ([[NSString stringWithFormat:@"%@",dic[@"type"]] isEqualToString:@"fwsm"]) {  
217 - if (success) {  
218 - success(dic[@"detailUrl"],dic[@"title"]);  
219 - return ;  
220 - }  
221 - }  
222 - }  
223 - break;  
224 - case CNAgreementEmojiComplaints:  
225 - {  
226 - if ([[NSString stringWithFormat:@"%@",dic[@"type"]] isEqualToString:@"tssm"]) {  
227 - if (success) {  
228 - success(dic[@"detailUrl"],dic[@"title"]);  
229 - return ;  
230 - }  
231 - }  
232 - }  
233 - break;  
234 - case CNAgreementEnterpriseQualification:  
235 - {  
236 - if ([[NSString stringWithFormat:@"%@",dic[@"type"]] isEqualToString:@"qyzz"]) {  
237 - if (success) {  
238 - success(dic[@"detailUrl"],dic[@"title"]);  
239 - return ;  
240 - }  
241 - }  
242 - }  
243 - break;  
244 - default:  
245 - break;  
246 - }  
247 -  
248 - }  
249 -  
250 - }  
251 - if (failure) {  
252 - failure(error);  
253 - }  
254 - }  
255 - }];  
256 -  
257 -}  
258 -  
259 -@end  
Example/CNLiveServices/UserAgreement/CNUserAgreementWebController.h deleted 100644 → 0
1 -//  
2 -// CNUserAgreementWebController.h  
3 -// CNLiveServices_Example  
4 -//  
5 -// Created by CNLive-zxw on 2019/7/30.  
6 -// Copyright © 2019 153993236@qq.com. All rights reserved.  
7 -//  
8 -  
9 -#import <UIKit/UIKit.h>  
10 -  
11 -NS_ASSUME_NONNULL_BEGIN  
12 -  
13 -@interface CNUserAgreementWebController : UIViewController  
14 -- (instancetype)initWithUrl:(NSString *)url name:(NSString *)name;  
15 -  
16 -@end  
17 -  
18 -NS_ASSUME_NONNULL_END  
Example/CNLiveServices/UserAgreement/CNUserAgreementWebController.m deleted 100644 → 0
1 -//  
2 -// CNUserAgreementWebController.m  
3 -// CNLiveServices_Example  
4 -//  
5 -// Created by CNLive-zxw on 2019/7/30.  
6 -// Copyright © 2019 153993236@qq.com. All rights reserved.  
7 -//  
8 -  
9 -#import "CNUserAgreementWebController.h"  
10 -#import <WebKit/WebKit.h>  
11 -  
12 -@interface CNUserAgreementWebController ()<WKUIDelegate, WKNavigationDelegate>  
13 -@property (nonatomic, copy) NSString *url;  
14 -@property (nonatomic, copy) NSString *name;  
15 -@property (nonatomic, strong) WKWebView *webView;  
16 -@property (nonatomic, strong) UIProgressView *processView;  
17 -@property (nonatomic, weak) UILabel *titleLabel;  
18 -  
19 -@end  
20 -  
21 -@implementation CNUserAgreementWebController  
22 -  
23 -- (instancetype)initWithUrl:(NSString *)url name:(NSString *)name {  
24 - self = [super init];  
25 - if (self) {  
26 - self.url = url;  
27 - self.name = name;  
28 - }  
29 - return self;  
30 -}  
31 -  
32 -- (void)setName:(NSString *)name{  
33 - _name = name;  
34 - _titleLabel.text = name;  
35 -  
36 -}  
37 -  
38 -#pragma mark - 加载数据  
39 -- (void)loadUrl {  
40 - NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:self.url] cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];  
41 - [self.webView loadRequest:theRequest];  
42 -  
43 -}  
44 -  
45 -#pragma mark - 生命周期  
46 -- (void)viewWillAppear:(BOOL)animated {  
47 - [super viewWillAppear:animated];  
48 - self.navigationController.navigationBarHidden = YES;  
49 -  
50 -}  
51 -  
52 -- (void)viewWillDisappear:(BOOL)animated {  
53 - [super viewWillDisappear:animated];  
54 - self.navigationController.navigationBarHidden = NO;  
55 -  
56 -}  
57 -  
58 -- (void)viewDidLoad {  
59 - [super viewDidLoad];  
60 - self.view.backgroundColor = [UIColor whiteColor];  
61 - if (@available(iOS 11, *)) {  
62 - self.webView.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentAutomatic;  
63 - }  
64 - else {  
65 - self.automaticallyAdjustsScrollViewInsets = NO;  
66 - }  
67 - [self setupNavigationBar];  
68 - [self setupUI];  
69 - [self loadUrl];  
70 -  
71 -}  
72 -  
73 -- (void)dealloc {  
74 - NSLog(@"CNUserAgreementWebController dealloc");  
75 - [self.webView stopLoading];  
76 - [self.webView removeObserver:self forKeyPath:@"estimatedProgress"];  
77 - if (!self.name) {  
78 - [self.webView removeObserver:self forKeyPath:@"title"];  
79 - }  
80 - self.webView.UIDelegate = nil;  
81 - self.webView.navigationDelegate = nil;  
82 - self.webView = nil;  
83 - [self clearWKCache];  
84 -  
85 -}  
86 -  
87 -#pragma mark - 创建导航条  
88 -- (void)setupNavigationBar {  
89 - UIView *navView = [[UIView alloc] initWithFrame:CGRectMake(0, [UIApplication sharedApplication].statusBarFrame.size.height, [UIScreen mainScreen].bounds.size.width, 44)];  
90 - navView.backgroundColor = [UIColor clearColor];  
91 - [self.view bringSubviewToFront:navView];  
92 - [self.view addSubview:navView];  
93 -  
94 - UIButton *leftBtn = [UIButton buttonWithType:UIButtonTypeSystem];  
95 - leftBtn.frame = CGRectMake(0, 0, 44, 44);  
96 - [leftBtn setImage:[[UIImage imageNamed:@"black_back"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];  
97 - [leftBtn setContentHorizontalAlignment:UIControlContentHorizontalAlignmentLeft];  
98 - leftBtn.imageEdgeInsets = UIEdgeInsetsMake(0,15,0,0);  
99 - [leftBtn addTarget:self action:@selector(goBack) forControlEvents:UIControlEventTouchUpInside];  
100 - [navView addSubview:leftBtn];  
101 -  
102 - UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(([[UIScreen mainScreen] bounds].size.width - 200)/2.0, 0, 200, 44)];  
103 - titleLabel.font = [UIFont boldSystemFontOfSize:17];  
104 - titleLabel.textColor = [UIColor blackColor];  
105 - titleLabel.text = self.name;  
106 - titleLabel.textAlignment = NSTextAlignmentCenter;  
107 - [navView addSubview:titleLabel];  
108 - _titleLabel = titleLabel;  
109 -  
110 -}  
111 -  
112 -- (void)setupUI {  
113 - WKWebViewConfiguration * configuration = [[WKWebViewConfiguration alloc] init];  
114 - configuration.allowsInlineMediaPlayback = YES;  
115 - WKPreferences *preferences = [WKPreferences new];  
116 - preferences.javaScriptCanOpenWindowsAutomatically = YES;  
117 - configuration.preferences = preferences;  
118 - self.webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, [UIApplication sharedApplication].statusBarFrame.size.height+44, [[UIScreen mainScreen] bounds].size.width, [[UIScreen mainScreen] bounds].size.height-([UIApplication sharedApplication].statusBarFrame.size.height+44)) configuration:configuration];  
119 - _webView.UIDelegate = self;  
120 - _webView.navigationDelegate = self;  
121 - _webView.contentMode = UIViewContentModeScaleAspectFit;  
122 - _webView.scrollView.showsHorizontalScrollIndicator = NO;  
123 - _webView.allowsBackForwardNavigationGestures = YES;  
124 - _webView.allowsLinkPreview = NO;  
125 - [self.view addSubview:self.webView];  
126 -  
127 - self.processView = [[UIProgressView alloc] initWithFrame:CGRectMake(0, ([UIApplication sharedApplication].statusBarFrame.size.height+44)+0.5, [[UIScreen mainScreen] bounds].size.width, 1)];  
128 - _processView.progressTintColor = [UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0];  
129 - _processView.trackTintColor = [UIColor whiteColor];  
130 - [self.view addSubview:self.processView];  
131 -  
132 - [self.webView addObserver:self forKeyPath:@"estimatedProgress" options:NSKeyValueObservingOptionNew context:nil];  
133 - if (!self.name) {  
134 - [self.webView addObserver:self forKeyPath:@"title" options:NSKeyValueObservingOptionNew context:NULL];  
135 - }  
136 -  
137 -}  
138 -  
139 -#pragma mark - WKNavigationDelegate  
140 -// 在发送请求之前,决定是否跳转  
141 -- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler{  
142 - //允许跳转  
143 - decisionHandler(WKNavigationActionPolicyAllow);  
144 -  
145 -}  
146 -  
147 -// 页面开始加载时调用  
148 -- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation{  
149 -  
150 -}  
151 -  
152 -// 在收到响应后,决定是否跳转  
153 -- (void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler{  
154 - //允许跳转  
155 - decisionHandler(WKNavigationResponsePolicyAllow);  
156 - //不允许跳转  
157 - //decisionHandler(WKNavigationResponsePolicyCancel);  
158 -}  
159 -  
160 -// 当内容开始返回时调用  
161 -- (void)webView:(WKWebView *)webView didCommitNavigation:(WKNavigation *)navigation{  
162 -  
163 -}  
164 -  
165 -// 页面加载完成之后调用  
166 -- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation{  
167 -  
168 -}  
169 -  
170 -// 页面加载失败时调用  
171 -- (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(null_unspecified WKNavigation *)navigation withError:(nonnull NSError *)error{  
172 -  
173 -}  
174 -  
175 -// 接收到服务器跳转请求之后调用(重定向)  
176 -- (void)webView:(WKWebView *)webView didReceiveServerRedirectForProvisionalNavigation:(WKNavigation *)navigation{  
177 -  
178 -}  
179 -  
180 -#pragma mark - 响应方法  
181 -//回退goBack  
182 -- (void)goBack {  
183 - if ([self.webView canGoBack]) {  
184 - [self.webView goBack];  
185 - }  
186 - else {  
187 - [self closeClick];  
188 - }  
189 -}  
190 -  
191 -//关闭pop  
192 -- (void)closeClick {  
193 - if (self.presentingViewController != nil) {  
194 - [self dismissViewControllerAnimated:NO completion:nil];  
195 -  
196 - }  
197 - else {  
198 - [self.navigationController popViewControllerAnimated:YES];  
199 - }  
200 -}  
201 -  
202 -#pragma mark - KVO  
203 -- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context {  
204 - if ([keyPath isEqualToString:@"estimatedProgress"]) {  
205 - if (object == self.webView) {  
206 - [self.processView setAlpha:1.0f];  
207 - [self.processView setProgress:self.webView.estimatedProgress animated:YES];  
208 -  
209 - if(self.webView.estimatedProgress >= 1.0f) {  
210 -  
211 - [UIView animateWithDuration:0.3 delay:0.5 options:UIViewAnimationOptionCurveEaseOut animations:^{  
212 - [self.processView setAlpha:0.0f];  
213 -  
214 - } completion:^(BOOL finished) {  
215 - [self.processView setProgress:0.0f animated:NO];  
216 -  
217 - }];  
218 -  
219 - }  
220 -  
221 - }  
222 - else {  
223 - [super observeValueForKeyPath:keyPath ofObject:object change:change context:context];  
224 - }  
225 -  
226 - }  
227 - else if ([keyPath isEqualToString:@"title"]){  
228 - if (object == self.webView) {  
229 - if (self.webView.title.length != 0) {  
230 - self.name = self.webView.title;  
231 -  
232 - }  
233 - }  
234 - else {  
235 - [super observeValueForKeyPath:keyPath ofObject:object change:change context:context];  
236 - }  
237 - }  
238 - else {  
239 - [super observeValueForKeyPath:keyPath ofObject:object change:change context:context];  
240 -  
241 - }  
242 -}  
243 -  
244 -#pragma mark - 清除缓存  
245 -// 清除缓存  
246 -- (void)clearWKCache {  
247 - NSArray *types = @[WKWebsiteDataTypeDiskCache,WKWebsiteDataTypeOfflineWebApplicationCache,WKWebsiteDataTypeMemoryCache,WKWebsiteDataTypeIndexedDBDatabases,WKWebsiteDataTypeWebSQLDatabases];  
248 - NSSet *websiteDataTypes = [NSSet setWithArray:types];  
249 - NSDate *dateFrom = [NSDate dateWithTimeIntervalSince1970:0];  
250 - [[WKWebsiteDataStore defaultDataStore] removeDataOfTypes:websiteDataTypes modifiedSince:dateFrom completionHandler:^{  
251 - NSLog(@"清楚缓存完毕");  
252 - }];  
253 -  
254 -}  
255 -  
256 -@end  
Example/Podfile
@@ -6,8 +6,6 @@ platform :ios, &#39;9.0&#39; @@ -6,8 +6,6 @@ platform :ios, &#39;9.0&#39;
6 6
7 target 'CNLiveServices_Example' do 7 target 'CNLiveServices_Example' do
8 pod 'CNLiveServices', :path => '../' 8 pod 'CNLiveServices', :path => '../'
9 - pod 'CNLiveRequestBastKit'  
10 - pod 'MJExtension'  
11 9
12 target 'CNLiveServices_Tests' do 10 target 'CNLiveServices_Tests' do
13 inherit! :search_paths 11 inherit! :search_paths