Commit c16dc7d355fa59fc518a62377fec1e515c756cca

Authored by zhangxiaowen
1 parent 5b1cc58e

no message

CNLiveSettingModule.podspec
@@ -159,6 +159,9 @@ TODO: 网家家-设置模块. @@ -159,6 +159,9 @@ TODO: 网家家-设置模块.
159 159
160 # 分类 160 # 分类
161 s.dependency 'CNLiveCategory' 161 s.dependency 'CNLiveCategory'
  162 +
  163 + # 自定义控件
  164 + s.dependency 'CNLiveCustomControl'
162 165
163 s.static_framework = true 166 s.static_framework = true
164 167
CNLiveSettingModule/Classes/AboutUs/CNLiveAboutUsController.m
@@ -15,14 +15,14 @@ @@ -15,14 +15,14 @@
15 #import "CNLiveEnvironment.h" 15 #import "CNLiveEnvironment.h"
16 #import "CNLiveCategory.h" 16 #import "CNLiveCategory.h"
17 #import "CNLiveBaseKit.h" 17 #import "CNLiveBaseKit.h"
  18 +#import "CNLiveNavigationBar.h"
18 19
19 #import "CNLiveSettingModel.h" 20 #import "CNLiveSettingModel.h"
20 #import "CNLiveSettingCell.h" 21 #import "CNLiveSettingCell.h"
21 -#import "CNLiveSettingNavigationBar.h"  
22 22
23 @interface CNLiveAboutUsController () 23 @interface CNLiveAboutUsController ()
24 -<UITableViewDelegate, UITableViewDataSource, CNLiveSettingNavigationBarDelegate>  
25 -@property (nonatomic, strong) CNLiveSettingNavigationBar *navigationBar; 24 +<UITableViewDelegate, UITableViewDataSource>
  25 +@property (nonatomic, strong) CNLiveNavigationBar *navigationBar;
26 @property (nonatomic, strong) UITableView *tableView; 26 @property (nonatomic, strong) UITableView *tableView;
27 @property (nonatomic, strong) UIView *headerView; 27 @property (nonatomic, strong) UIView *headerView;
28 @property (nonatomic, strong) UIView *footerView; 28 @property (nonatomic, strong) UIView *footerView;
@@ -231,13 +231,16 @@ static const NSInteger timeValue = 1.5; @@ -231,13 +231,16 @@ static const NSInteger timeValue = 1.5;
231 return _data; 231 return _data;
232 } 232 }
233 233
234 -- (CNLiveSettingNavigationBar *)navigationBar { 234 +- (CNLiveNavigationBar *)navigationBar {
235 if (!_navigationBar) { 235 if (!_navigationBar) {
236 - _navigationBar = [[CNLiveSettingNavigationBar alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, NavigationContentTop)];  
237 - _navigationBar.backgroundColor = [UIColor whiteColor];  
238 - _navigationBar.delegate = self; 236 + _navigationBar = [CNLiveNavigationBar navigationBar];
239 _navigationBar.title.text = [NSString stringWithFormat:@"关于%@",DisplayName]; 237 _navigationBar.title.text = [NSString stringWithFormat:@"关于%@",DisplayName];
240 - _navigationBar.right = nil; 238 + __weak typeof(self) weakSelf = self;
  239 + _navigationBar.onClickLeftButton = ^{
  240 + __strong typeof(weakSelf) strongSelf = weakSelf;
  241 + if(!strongSelf) return ;
  242 + [strongSelf goBack];
  243 + };
241 } 244 }
242 return _navigationBar; 245 return _navigationBar;
243 } 246 }
@@ -266,7 +269,7 @@ static const NSInteger timeValue = 1.5; @@ -266,7 +269,7 @@ static const NSInteger timeValue = 1.5;
266 _headerView.clipsToBounds = YES; 269 _headerView.clipsToBounds = YES;
267 _headerView.backgroundColor = [UIColor colorWithRed:242/255.0 green:242/255.0 blue:242/255.0 alpha:1.0]; 270 _headerView.backgroundColor = [UIColor colorWithRed:242/255.0 green:242/255.0 blue:242/255.0 alpha:1.0];
268 UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH-70)/2.0, 30, 70, 140)]; 271 UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH-70)/2.0, 30, 70, 140)];
269 - UIImage *image = [self getImageWithImageName:@"about_us_icon" bundleName:@"CNLiveSettingModule" targetClass:[CNLiveSettingNavigationBar class]]; 272 + UIImage *image = [self getImageWithImageName:@"about_us_icon" bundleName:@"CNLiveSettingModule" targetClass:[self class]];
270 imageView.image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; 273 imageView.image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
271 imageView.contentMode = UIViewContentModeScaleAspectFill; 274 imageView.contentMode = UIViewContentModeScaleAspectFill;
272 imageView.clipsToBounds = YES; 275 imageView.clipsToBounds = YES;
@@ -306,13 +309,4 @@ static const NSInteger timeValue = 1.5; @@ -306,13 +309,4 @@ static const NSInteger timeValue = 1.5;
306 } 309 }
307 } 310 }
308 311
309 -#pragma mark - CNLiveSettingNavigationBarDelegate  
310 -- (void)navigationBar:(CNLiveSettingNavigationBar *)navigationBar actionEvents:(NSString *)actionEvents{  
311 - if ([actionEvents isEqualToString:@"1"]) {  
312 - [self goBack];  
313 - }else if ([actionEvents isEqualToString:@"2"]){  
314 -  
315 - }  
316 -}  
317 -  
318 @end 312 @end
CNLiveSettingModule/Classes/BackgroundImage/CNLiveBackgroundImageController.m
@@ -19,14 +19,14 @@ @@ -19,14 +19,14 @@
19 #import "CNLiveSettingModel.h" 19 #import "CNLiveSettingModel.h"
20 #import "CNLiveSettingCell.h" 20 #import "CNLiveSettingCell.h"
21 #import "CNLiveServices.h" 21 #import "CNLiveServices.h"
22 -#import "CNLiveSettingNavigationBar.h" 22 +#import "CNLiveNavigationBar.h"
23 #import "CNLiveBaseKit.h" 23 #import "CNLiveBaseKit.h"
24 24
25 @interface CNLiveBackgroundImageController () 25 @interface CNLiveBackgroundImageController ()
26 -<UITableViewDelegate, UITableViewDataSource, CNLiveSettingNavigationBarDelegate,UIImagePickerControllerDelegate,UINavigationControllerDelegate,TZImagePickerControllerDelegate>{ 26 +<UITableViewDelegate, UITableViewDataSource,UIImagePickerControllerDelegate,UINavigationControllerDelegate,TZImagePickerControllerDelegate>{
27 UIImage *_selectedImage;// 当 isSettingAll为 YES 才需要用到 27 UIImage *_selectedImage;// 当 isSettingAll为 YES 才需要用到
28 } 28 }
29 -@property (nonatomic, strong) CNLiveSettingNavigationBar *navigationBar; 29 +@property (nonatomic, strong) CNLiveNavigationBar *navigationBar;
30 @property (nonatomic, strong) UITableView *tableView; 30 @property (nonatomic, strong) UITableView *tableView;
31 @property (nonatomic, strong) UIButton *setting; 31 @property (nonatomic, strong) UIButton *setting;
32 @property (nonatomic, strong) NSMutableArray *data; 32 @property (nonatomic, strong) NSMutableArray *data;
@@ -159,13 +159,16 @@ static const NSInteger timeValue = 1.5; @@ -159,13 +159,16 @@ static const NSInteger timeValue = 1.5;
159 return _data; 159 return _data;
160 } 160 }
161 161
162 -- (CNLiveSettingNavigationBar *)navigationBar { 162 +- (CNLiveNavigationBar *)navigationBar {
163 if (!_navigationBar) { 163 if (!_navigationBar) {
164 - _navigationBar = [[CNLiveSettingNavigationBar alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, NavigationContentTop)];  
165 - _navigationBar.backgroundColor = [UIColor whiteColor];  
166 - _navigationBar.delegate = self; 164 + _navigationBar = [CNLiveNavigationBar navigationBar];
167 _navigationBar.title.text = @"聊天背景"; 165 _navigationBar.title.text = @"聊天背景";
168 - _navigationBar.right = nil; 166 + __weak typeof(self) weakSelf = self;
  167 + _navigationBar.onClickLeftButton = ^{
  168 + __strong typeof(weakSelf) strongSelf = weakSelf;
  169 + if(!strongSelf) return ;
  170 + [strongSelf goBack];
  171 + };
169 } 172 }
170 return _navigationBar; 173 return _navigationBar;
171 } 174 }
@@ -299,14 +302,5 @@ static const NSInteger timeValue = 1.5; @@ -299,14 +302,5 @@ static const NSInteger timeValue = 1.5;
299 }); 302 });
300 } 303 }
301 304
302 -#pragma mark - CNLiveSettingNavigationBarDelegate  
303 -- (void)navigationBar:(CNLiveSettingNavigationBar *)navigationBar actionEvents:(NSString *)actionEvents{  
304 - if ([actionEvents isEqualToString:@"1"]) {  
305 - [self goBack];  
306 - }else if ([actionEvents isEqualToString:@"2"]){  
307 -  
308 - }  
309 -}  
310 -  
311 305
312 @end 306 @end
CNLiveSettingModule/Classes/Cancellation/CNLiveCancellationController.m
@@ -15,15 +15,15 @@ @@ -15,15 +15,15 @@
15 #import "CNLiveEnvironment.h" 15 #import "CNLiveEnvironment.h"
16 #import "CNUserInfoManager.h" 16 #import "CNUserInfoManager.h"
17 17
18 -#import "CNLiveSettingNavigationBar.h" 18 +#import "CNLiveNavigationBar.h"
19 #import "CNLiveCancellationView.h" 19 #import "CNLiveCancellationView.h"
20 20
21 //#import "CNIntegralRulesViewController.h" 21 //#import "CNIntegralRulesViewController.h"
22 //#import "CNMineHomeController.h" 22 //#import "CNMineHomeController.h"
23 #import "CNLiveUserAgreementManager.h" 23 #import "CNLiveUserAgreementManager.h"
24 24
25 -@interface CNLiveCancellationController ()<WKNavigationDelegate,WKUIDelegate,CNLiveCancellationViewDelegate,CNLiveSettingNavigationBarDelegate>  
26 -@property (nonatomic, strong) CNLiveSettingNavigationBar *navigationBar; 25 +@interface CNLiveCancellationController ()<WKNavigationDelegate,WKUIDelegate,CNLiveCancellationViewDelegate>
  26 +@property (nonatomic, strong) CNLiveNavigationBar *navigationBar;
27 @property (nonatomic, weak) WKWebView *webView; 27 @property (nonatomic, weak) WKWebView *webView;
28 @property (nonatomic, weak) CNLiveCancellationView *cancellationView; 28 @property (nonatomic, weak) CNLiveCancellationView *cancellationView;
29 29
@@ -243,25 +243,20 @@ static const NSInteger timeValue = 1.5; @@ -243,25 +243,20 @@ static const NSInteger timeValue = 1.5;
243 */ 243 */
244 244
245 #pragma mark - 懒加载 245 #pragma mark - 懒加载
246 -- (CNLiveSettingNavigationBar *)navigationBar { 246 +- (CNLiveNavigationBar *)navigationBar {
247 if (!_navigationBar) { 247 if (!_navigationBar) {
248 - _navigationBar = [[CNLiveSettingNavigationBar alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, NavigationContentTop)];  
249 - _navigationBar.backgroundColor = [UIColor whiteColor];  
250 - _navigationBar.delegate = self; 248 + _navigationBar = [CNLiveNavigationBar navigationBar];
251 _navigationBar.title.text = @"审核申请"; 249 _navigationBar.title.text = @"审核申请";
252 - _navigationBar.right = nil; 250 + __weak typeof(self) weakSelf = self;
  251 + _navigationBar.onClickLeftButton = ^{
  252 + __strong typeof(weakSelf) strongSelf = weakSelf;
  253 + if(!strongSelf) return ;
  254 + [strongSelf goBack];
  255 + };
253 } 256 }
254 return _navigationBar; 257 return _navigationBar;
255 } 258 }
256 259
257 -#pragma mark - CNLiveSettingNavigationBarDelegate  
258 -- (void)navigationBar:(CNLiveSettingNavigationBar *)navigationBar actionEvents:(NSString *)actionEvents{  
259 - if ([actionEvents isEqualToString:@"1"]) {  
260 - [self goBack];  
261 - }else if ([actionEvents isEqualToString:@"2"]){  
262 -  
263 - }  
264 -}  
265 #pragma mark - 响应方法 260 #pragma mark - 响应方法
266 - (void)goBack { 261 - (void)goBack {
267 if (self.presentingViewController != nil) { 262 if (self.presentingViewController != nil) {
CNLiveSettingModule/Classes/Controller/CNLiveSettingController.m
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 #import "CNLiveSettingModel.h" 17 #import "CNLiveSettingModel.h"
18 #import "CNLiveSettingCell.h" 18 #import "CNLiveSettingCell.h"
19 #import "CNLiveServices.h" 19 #import "CNLiveServices.h"
20 -#import "CNLiveSettingNavigationBar.h" 20 +#import "CNLiveNavigationBar.h"
21 21
22 #import "CNLiveUpdateTelController.h"//修改手机号 22 #import "CNLiveUpdateTelController.h"//修改手机号
23 #import "CNLivePrivacyController.h"//隐私 23 #import "CNLivePrivacyController.h"//隐私
@@ -28,8 +28,8 @@ @@ -28,8 +28,8 @@
28 #import "CNLiveBaseKit.h" 28 #import "CNLiveBaseKit.h"
29 29
30 @interface CNLiveSettingController () 30 @interface CNLiveSettingController ()
31 -<UITableViewDelegate, UITableViewDataSource, CNLiveSettingNavigationBarDelegate>  
32 -@property (nonatomic, strong) CNLiveSettingNavigationBar *navigationBar; 31 +<UITableViewDelegate, UITableViewDataSource>
  32 +@property (nonatomic, strong) CNLiveNavigationBar *navigationBar;
33 @property (nonatomic, strong) UITableView *tableView; 33 @property (nonatomic, strong) UITableView *tableView;
34 @property (nonatomic, strong) UIButton *logout; 34 @property (nonatomic, strong) UIButton *logout;
35 @property (nonatomic, strong) NSMutableArray *data; 35 @property (nonatomic, strong) NSMutableArray *data;
@@ -274,13 +274,14 @@ static const NSInteger timeValue = 1.5; @@ -274,13 +274,14 @@ static const NSInteger timeValue = 1.5;
274 return _data; 274 return _data;
275 } 275 }
276 276
277 -- (CNLiveSettingNavigationBar *)navigationBar { 277 +- (CNLiveNavigationBar *)navigationBar {
278 if (!_navigationBar) { 278 if (!_navigationBar) {
279 - _navigationBar = [[CNLiveSettingNavigationBar alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, NavigationContentTop)];  
280 - _navigationBar.backgroundColor = [UIColor whiteColor];  
281 - _navigationBar.delegate = self; 279 + _navigationBar = [CNLiveNavigationBar navigationBar];
282 _navigationBar.title.text = @"设置"; 280 _navigationBar.title.text = @"设置";
283 - _navigationBar.right = nil; 281 + __weak typeof(self) weakSelf = self;
  282 + _navigationBar.onClickLeftButton = ^{
  283 + [weakSelf goBack];
  284 + };
284 } 285 }
285 return _navigationBar; 286 return _navigationBar;
286 } 287 }
@@ -376,13 +377,4 @@ static const NSInteger timeValue = 1.5; @@ -376,13 +377,4 @@ static const NSInteger timeValue = 1.5;
376 }]; 377 }];
377 } 378 }
378 379
379 -#pragma mark - CNLiveSettingNavigationBarDelegate  
380 -- (void)navigationBar:(CNLiveSettingNavigationBar *)navigationBar actionEvents:(NSString *)actionEvents{  
381 - if ([actionEvents isEqualToString:@"1"]) {  
382 - [self goBack];  
383 - }else if ([actionEvents isEqualToString:@"2"]){  
384 -  
385 - }  
386 -}  
387 -  
388 @end 380 @end
CNLiveSettingModule/Classes/FontSIze/CNLiveFontSettingController.m
@@ -12,14 +12,14 @@ @@ -12,14 +12,14 @@
12 #import "CNLiveBaseKit.h" 12 #import "CNLiveBaseKit.h"
13 #import "CNUserInfoManager.h" 13 #import "CNUserInfoManager.h"
14 #import "CNLiveCategory.h" 14 #import "CNLiveCategory.h"
  15 +#import "CNLiveNavigationBar.h"
15 16
16 -#import "CNLiveSettingNavigationBar.h"  
17 #import "CNLiveFontSettingFrame.h" 17 #import "CNLiveFontSettingFrame.h"
18 #import "CNLiveFontSettingModel.h" 18 #import "CNLiveFontSettingModel.h"
19 #import "CNLiveFontSettingCell.h" 19 #import "CNLiveFontSettingCell.h"
20 20
21 -@interface CNLiveFontSettingController ()<UITableViewDelegate, UITableViewDataSource, CNLiveSettingNavigationBarDelegate>  
22 -@property (nonatomic, strong) CNLiveSettingNavigationBar *navigationBar; 21 +@interface CNLiveFontSettingController ()<UITableViewDelegate, UITableViewDataSource>
  22 +@property (nonatomic, strong) CNLiveNavigationBar *navigationBar;
23 @property (nonatomic, strong) UITableView *tableView; 23 @property (nonatomic, strong) UITableView *tableView;
24 @property (nonatomic, strong) NSMutableArray *data; 24 @property (nonatomic, strong) NSMutableArray *data;
25 25
@@ -157,21 +157,6 @@ @@ -157,21 +157,6 @@
157 return FontSettingFrame.cellHeight; 157 return FontSettingFrame.cellHeight;
158 } 158 }
159 159
160 -#pragma mark - CNLiveSettingNavigationBarDelegate  
161 -- (void)navigationBar:(CNLiveSettingNavigationBar *)navigationBar actionEvents:(NSString *)actionEvents{  
162 - if ([actionEvents isEqualToString:@"1"]) {  
163 - [[NSUserDefaults standardUserDefaults] setInteger:tempCoefficient forKey:@"CNSizeFontCoefficient"];  
164 -  
165 - }else if ([actionEvents isEqualToString:@"2"]){  
166 - NSInteger temp = [[NSUserDefaults standardUserDefaults] integerForKey:@"CNSizeFontCoefficient"];  
167 - if (temp != tempCoefficient) {  
168 - [[NSNotificationCenter defaultCenter] postNotificationName:@"CNFONTSIZECHANGE" object:nil];  
169 - }  
170 - }  
171 - [self goBack];  
172 -  
173 -}  
174 -  
175 #pragma mark - 懒加载 160 #pragma mark - 懒加载
176 - (NSMutableArray *)data{ 161 - (NSMutableArray *)data{
177 if (_data == nil) { 162 if (_data == nil) {
@@ -191,20 +176,35 @@ @@ -191,20 +176,35 @@
191 return _tableView; 176 return _tableView;
192 } 177 }
193 178
194 -- (CNLiveSettingNavigationBar *)navigationBar { 179 +- (CNLiveNavigationBar *)navigationBar {
195 if (!_navigationBar) { 180 if (!_navigationBar) {
196 - _navigationBar = [[CNLiveSettingNavigationBar alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, NavigationContentTop)];  
197 - _navigationBar.backgroundColor = [UIColor whiteColor];  
198 - _navigationBar.delegate = self;  
199 - [_navigationBar.left setTitle:@"取消" forState:UIControlStateNormal];  
200 - [_navigationBar.left setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; 181 + _navigationBar = [CNLiveNavigationBar navigationBar];
  182 + _navigationBar.leftTitle = @"取消";
201 [_navigationBar.left setImage:nil forState:UIControlStateNormal]; 183 [_navigationBar.left setImage:nil forState:UIControlStateNormal];
202 _navigationBar.title.text = @"设置字体大小"; 184 _navigationBar.title.text = @"设置字体大小";
203 _navigationBar.left.titleLabel.font = [UIFont systemFontOfSize:17.0]; 185 _navigationBar.left.titleLabel.font = [UIFont systemFontOfSize:17.0];
204 _navigationBar.right.titleLabel.font = [UIFont systemFontOfSize:17.0]; 186 _navigationBar.right.titleLabel.font = [UIFont systemFontOfSize:17.0];
205 - [_navigationBar.right setTitle:@"完成" forState:UIControlStateNormal];  
206 - [_navigationBar.right setTitleColor:[UIColor colorWithRed:31/255.0 green:185/255.0 blue:34/255.0 alpha:1.0] forState:UIControlStateNormal]; 187 + _navigationBar.rightTitle = @"完成";
  188 + [_navigationBar.right setTitleColor:[UIColor colorWithRed:31/255.0 green:185/255.0 blue:34/255.0 alpha:1.0] forState:UIControlStateNormal];
207 [_navigationBar.right setTitleColor:[UIColor colorWithRed:63/255.0 green:109/255.0 blue:61/255.0 alpha:1.0] forState:UIControlStateSelected]; 189 [_navigationBar.right setTitleColor:[UIColor colorWithRed:63/255.0 green:109/255.0 blue:61/255.0 alpha:1.0] forState:UIControlStateSelected];
  190 + __weak typeof(self) weakSelf = self;
  191 + _navigationBar.onClickLeftButton = ^{
  192 + __strong typeof(weakSelf) strongSelf = weakSelf;
  193 + if(!strongSelf) return ;
  194 + [[NSUserDefaults standardUserDefaults] setInteger:strongSelf->tempCoefficient forKey:@"CNSizeFontCoefficient"];
  195 + [strongSelf goBack];
  196 +
  197 + };
  198 + _navigationBar.onClickRightButton = ^{
  199 + __strong typeof(weakSelf) strongSelf = weakSelf;
  200 + if(!strongSelf) return ;
  201 + NSInteger temp = [[NSUserDefaults standardUserDefaults] integerForKey:@"CNSizeFontCoefficient"];
  202 + if (temp != strongSelf->tempCoefficient) {
  203 + [[NSNotificationCenter defaultCenter] postNotificationName:@"CNFONTSIZECHANGE" object:nil];
  204 + }
  205 + [strongSelf goBack];
  206 +
  207 + };
208 } 208 }
209 return _navigationBar; 209 return _navigationBar;
210 } 210 }
CNLiveSettingModule/Classes/Privacy/CNLivePrivacyController.m
@@ -15,8 +15,8 @@ @@ -15,8 +15,8 @@
15 #import "CNLiveNetworking.h" 15 #import "CNLiveNetworking.h"
16 #import "CNLiveEnvironment.h" 16 #import "CNLiveEnvironment.h"
17 #import "CNUserInfoManager.h" 17 #import "CNUserInfoManager.h"
  18 +#import "CNLiveNavigationBar.h"
18 19
19 -#import "CNLiveSettingNavigationBar.h"  
20 #import "CNLivePrivacyCell.h" 20 #import "CNLivePrivacyCell.h"
21 #import "CNLivePrivacyHeaderView.h" 21 #import "CNLivePrivacyHeaderView.h"
22 #import "CNLivePrivacyModel.h" 22 #import "CNLivePrivacyModel.h"
@@ -25,8 +25,8 @@ @@ -25,8 +25,8 @@
25 #import "CNLiveUserDefaultsModel.h" 25 #import "CNLiveUserDefaultsModel.h"
26 #import "CNLivePrivacyRequest.h" 26 #import "CNLivePrivacyRequest.h"
27 27
28 -@interface CNLivePrivacyController ()<UITableViewDelegate,UITableViewDataSource,CNLiveSettingNavigationBarDelegate>  
29 -@property (nonatomic, strong) CNLiveSettingNavigationBar *navigationBar; 28 +@interface CNLivePrivacyController ()<UITableViewDelegate,UITableViewDataSource>
  29 +@property (nonatomic, strong) CNLiveNavigationBar *navigationBar;
30 @property (nonatomic, strong) UITableView *tableView; 30 @property (nonatomic, strong) UITableView *tableView;
31 31
32 @property (nonatomic, strong) CNLivePrivacyModel *model; 32 @property (nonatomic, strong) CNLivePrivacyModel *model;
@@ -189,13 +189,6 @@ @@ -189,13 +189,6 @@
189 189
190 } 190 }
191 191
192 -#pragma mark - CNLiveSettingNavigationBarDelegate  
193 -- (void)navigationBar:(CNLiveSettingNavigationBar *)navigationBar actionEvents:(NSString *)actionEvents{  
194 - if ([actionEvents isEqualToString:@"1"]) {  
195 - [self goBack];  
196 - }  
197 -}  
198 -  
199 #pragma mark - Action 192 #pragma mark - Action
200 - (void)goBack { 193 - (void)goBack {
201 if (self.presentingViewController != nil) { 194 if (self.presentingViewController != nil) {
@@ -207,13 +200,18 @@ @@ -207,13 +200,18 @@
207 } 200 }
208 201
209 #pragma mark - Lazy loading 202 #pragma mark - Lazy loading
210 -- (CNLiveSettingNavigationBar *)navigationBar { 203 +- (CNLiveNavigationBar *)navigationBar {
211 if (!_navigationBar) { 204 if (!_navigationBar) {
212 - _navigationBar = [[CNLiveSettingNavigationBar alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, NavigationContentTop)];  
213 - _navigationBar.backgroundColor = [UIColor whiteColor];  
214 - _navigationBar.delegate = self; 205 + _navigationBar = [CNLiveNavigationBar navigationBar];
215 _navigationBar.title.text = @"隐私"; 206 _navigationBar.title.text = @"隐私";
216 - _navigationBar.right = nil; 207 +
  208 + __weak typeof(self) weakSelf = self;
  209 + _navigationBar.onClickLeftButton = ^{
  210 + __strong typeof(weakSelf) strongSelf = weakSelf;
  211 + if(!strongSelf) return ;
  212 + [strongSelf goBack];
  213 + };
  214 +
217 } 215 }
218 return _navigationBar; 216 return _navigationBar;
219 } 217 }
CNLiveSettingModule/Classes/UpdateTel/CNLiveUpdateTelController.m
@@ -18,12 +18,12 @@ @@ -18,12 +18,12 @@
18 #import "CNLiveCategory.h" 18 #import "CNLiveCategory.h"
19 #import "CNLiveBaseKit.h" 19 #import "CNLiveBaseKit.h"
20 20
21 -#import "CNLiveSettingNavigationBar.h" 21 +#import "CNLiveNavigationBar.h"
22 #import "CNLiveUpdateTelView.h" 22 #import "CNLiveUpdateTelView.h"
23 23
24 -@interface CNLiveUpdateTelController()<UITextFieldDelegate, CNLiveSettingNavigationBarDelegate, CNLiveUpdateTelViewDelegate, ChooseCountriesDelegate> 24 +@interface CNLiveUpdateTelController()<UITextFieldDelegate, CNLiveUpdateTelViewDelegate, ChooseCountriesDelegate>
25 25
26 -@property (nonatomic, strong) CNLiveSettingNavigationBar *navigationBar; 26 +@property (nonatomic, strong) CNLiveNavigationBar *navigationBar;
27 @property (nonatomic, strong) CNLiveUpdateTelView *updateTel;//背景 27 @property (nonatomic, strong) CNLiveUpdateTelView *updateTel;//背景
28 @property (nonatomic, strong) YYLabel *connection; 28 @property (nonatomic, strong) YYLabel *connection;
29 29
@@ -55,8 +55,7 @@ static const NSInteger timeValue = 1.5; @@ -55,8 +55,7 @@ static const NSInteger timeValue = 1.5;
55 __strong typeof(weakSelf) strongSelf = weakSelf; 55 __strong typeof(weakSelf) strongSelf = weakSelf;
56 if(!strongSelf) return ; 56 if(!strongSelf) return ;
57 [strongSelf.navigationController popViewControllerAnimated:YES]; 57 [strongSelf.navigationController popViewControllerAnimated:YES];
58 -  
59 - }]; 58 + }];
60 59
61 QMUIAlertController *alertController = [QMUIAlertController alertControllerWithTitle:@"更换手机号将只能使用新绑定的手机号登录app,是否继续修改?" message:@"" preferredStyle:QMUIAlertControllerStyleAlert]; 60 QMUIAlertController *alertController = [QMUIAlertController alertControllerWithTitle:@"更换手机号将只能使用新绑定的手机号登录app,是否继续修改?" message:@"" preferredStyle:QMUIAlertControllerStyleAlert];
62 [alertController addAction:sure]; 61 [alertController addAction:sure];
@@ -86,7 +85,7 @@ static const NSInteger timeValue = 1.5; @@ -86,7 +85,7 @@ static const NSInteger timeValue = 1.5;
86 - (void)xw_layoutSubviews{ 85 - (void)xw_layoutSubviews{
87 [self.updateTel mas_makeConstraints:^(MASConstraintMaker *make) { 86 [self.updateTel mas_makeConstraints:^(MASConstraintMaker *make) {
88 make.left.right.equalTo(self.view); 87 make.left.right.equalTo(self.view);
89 - make.top.equalTo(self.view).offset(NavigationContentTop+1); 88 + make.top.equalTo(self.view).offset(NavigationContentTop);
90 make.height.mas_equalTo(220); 89 make.height.mas_equalTo(220);
91 }]; 90 }];
92 [self.connection mas_makeConstraints:^(MASConstraintMaker *make) { 91 [self.connection mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -126,13 +125,17 @@ static const NSInteger timeValue = 1.5; @@ -126,13 +125,17 @@ static const NSInteger timeValue = 1.5;
126 } 125 }
127 126
128 #pragma mark - Lazy Loading 127 #pragma mark - Lazy Loading
129 -- (CNLiveSettingNavigationBar *)navigationBar { 128 +- (CNLiveNavigationBar *)navigationBar {
130 if (!_navigationBar) { 129 if (!_navigationBar) {
131 - _navigationBar = [[CNLiveSettingNavigationBar alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, NavigationContentTop)];  
132 - _navigationBar.backgroundColor = [UIColor whiteColor];  
133 - _navigationBar.delegate = self; 130 + _navigationBar = [CNLiveNavigationBar navigationBar];
134 _navigationBar.title.text = @"更换手机号"; 131 _navigationBar.title.text = @"更换手机号";
135 - _navigationBar.right = nil; 132 + __weak typeof(self) weakSelf = self;
  133 + _navigationBar.onClickLeftButton = ^{
  134 + __strong typeof(weakSelf) strongSelf = weakSelf;
  135 + if(!strongSelf) return ;
  136 + [strongSelf.navigationController popViewControllerAnimated:YES];
  137 + };
  138 +
136 } 139 }
137 return _navigationBar; 140 return _navigationBar;
138 } 141 }
@@ -203,13 +206,4 @@ static const NSInteger timeValue = 1.5; @@ -203,13 +206,4 @@ static const NSInteger timeValue = 1.5;
203 } 206 }
204 */ 207 */
205 208
206 -#pragma mark - CNLiveSettingNavigationBarDelegate  
207 -- (void)navigationBar:(CNLiveSettingNavigationBar *)navigationBar actionEvents:(NSString *)actionEvents{  
208 - if ([actionEvents isEqualToString:@"1"]) {  
209 - [self.navigationController popViewControllerAnimated:YES];  
210 - }else if ([actionEvents isEqualToString:@"2"]){  
211 -  
212 - }  
213 -}  
214 -  
215 @end 209 @end
CNLiveSettingModule/Classes/View/CNLiveSettingNavigationBar.h deleted 100644 → 0
1 -//  
2 -// CNLiveSettingNavigationBar.m  
3 -// CNLiveSettingModule  
4 -//  
5 -// Created by 153993236@qq.com on 11/12/2019.  
6 -// Copyright (c) 2019 153993236@qq.com. All rights reserved.  
7 -//  
8 -  
9 -#import <UIKit/UIKit.h>  
10 -  
11 -NS_ASSUME_NONNULL_BEGIN  
12 -@class CNLiveSettingNavigationBar;  
13 -  
14 -@protocol CNLiveSettingNavigationBarDelegate <NSObject>  
15 -- (void)navigationBar:(CNLiveSettingNavigationBar *)navigationBar actionEvents:(NSString *)actionEvents;  
16 -  
17 -@end  
18 -  
19 -@interface CNLiveSettingNavigationBar : UIView  
20 -@property (nonatomic, weak) id<CNLiveSettingNavigationBarDelegate> delegate;  
21 -@property (nonatomic, strong) UIView *navView;  
22 -@property (nonatomic, strong) UIButton *left;  
23 -@property (nonatomic, strong) UILabel *title;  
24 -@property (nonatomic, strong, nullable) UIButton *right;  
25 -  
26 -  
27 -@end  
28 -  
29 -NS_ASSUME_NONNULL_END  
CNLiveSettingModule/Classes/View/CNLiveSettingNavigationBar.m deleted 100644 → 0
1 -//  
2 -// CNLiveSettingNavigationBar.m  
3 -// CNLiveSettingModule  
4 -//  
5 -// Created by 153993236@qq.com on 11/12/2019.  
6 -// Copyright © 2019 153993236@qq.com. All rights reserved.  
7 -//  
8 -  
9 -#import "CNLiveSettingNavigationBar.h"  
10 -#import "QMUIKit.h"  
11 -#import "CNLiveCategory.h"  
12 -  
13 -@interface CNLiveSettingNavigationBar ()  
14 -  
15 -@end  
16 -  
17 -@implementation CNLiveSettingNavigationBar  
18 -static const NSInteger margin = 15;  
19 -  
20 -- (instancetype)initWithFrame:(CGRect)frame{  
21 - self = [super initWithFrame:frame];  
22 - if(self){  
23 - self.userInteractionEnabled = YES;  
24 - self.backgroundColor = [UIColor clearColor];  
25 - [self createSubViews];  
26 - }  
27 - return self;  
28 -}  
29 -  
30 -- (void)dealloc {  
31 - NSLog(@"CNLiveSettingNavigationBar -- dealloc");  
32 -}  
33 -  
34 -- (void)createSubViews {  
35 - [self addSubview:self.navView];  
36 - [self addSubview:self.left];  
37 - [self addSubview:self.title];  
38 - [self addSubview:self.right];  
39 -}  
40 -  
41 -/*  
42 - // Only override drawRect: if you perform custom drawing.  
43 - // An empty implementation adversely affects performance during animation.  
44 - - (void)drawRect:(CGRect)rect {  
45 - // Drawing code  
46 - }  
47 - */  
48 -  
49 -#pragma mark - 懒加载  
50 -- (UIView *)navView {  
51 - if (!_navView) {  
52 - _navView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, NavigationContentTop)];  
53 - _navView.backgroundColor = [UIColor clearColor];  
54 - }  
55 - return _navView;  
56 -}  
57 -  
58 -- (UIButton *)left {  
59 - if (!_left) {  
60 - _left= [UIButton buttonWithType:UIButtonTypeCustom];  
61 - _left.adjustsImageWhenHighlighted = NO;  
62 - _left.frame = CGRectMake(margin, StatusBarHeight, NavigationBarHeight, NavigationBarHeight);  
63 - UIImage *image = [self getImageWithImageName:@"mine_back_black_b" bundleName:@"CNLiveSettingModule" targetClass:[CNLiveSettingNavigationBar class]];  
64 - [_left setImage:[image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];  
65 - _left.titleLabel.font = [UIFont systemFontOfSize:15];  
66 - [_left setContentHorizontalAlignment:UIControlContentHorizontalAlignmentLeft];  
67 - [_left addTarget:self action:@selector(goBack) forControlEvents:UIControlEventTouchUpInside];  
68 - }  
69 - return _left;  
70 -}  
71 -  
72 -- (UILabel *)title {  
73 - if (!_title) {  
74 - _title = [[UILabel alloc] initWithFrame:CGRectMake(margin+NavigationBarHeight, StatusBarHeight, SCREEN_WIDTH-2*(margin+NavigationBarHeight), NavigationBarHeight)];  
75 - [_title setFont:[UIFont systemFontOfSize:18]];  
76 - _title.textColor = [UIColor blackColor];  
77 - _title.textAlignment = NSTextAlignmentCenter;  
78 - }  
79 - return _title;  
80 -}  
81 -  
82 -- (UIButton *)right {  
83 - if (!_right) {  
84 - _right = [UIButton buttonWithType:UIButtonTypeCustom];  
85 - _right.frame = CGRectMake(SCREEN_WIDTH-NavigationBarHeight-margin, StatusBarHeight, NavigationBarHeight, NavigationBarHeight);  
86 - [_right setContentHorizontalAlignment:UIControlContentHorizontalAlignmentRight];  
87 - _right.adjustsImageWhenHighlighted = NO;  
88 - _right.titleLabel.font = [UIFont systemFontOfSize:15];  
89 - [_right setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];  
90 - [_right addTarget:self action:@selector(rightDidClicked:) forControlEvents:UIControlEventTouchUpInside];  
91 - }  
92 - return _right;  
93 -}  
94 -  
95 -#pragma mark - 响应方法  
96 -- (void)goBack{  
97 - if (self.delegate && [self.delegate respondsToSelector:@selector(navigationBar:actionEvents:)]) {  
98 - [self.delegate navigationBar:self actionEvents:@"1"];  
99 - }  
100 -}  
101 -- (void)rightDidClicked:(UIButton *)btn{  
102 - if (self.delegate && [self.delegate respondsToSelector:@selector(navigationBar:actionEvents:)]) {  
103 - [self.delegate navigationBar:self actionEvents:@"2"];  
104 - }  
105 -}  
106 -  
107 -@end  
Example/CNLiveSettingModule.xcodeproj/project.pbxproj
@@ -360,6 +360,7 @@ @@ -360,6 +360,7 @@
360 "${BUILT_PRODUCTS_DIR}/CNLiveChooseCountry/CNLiveChooseCountry.framework", 360 "${BUILT_PRODUCTS_DIR}/CNLiveChooseCountry/CNLiveChooseCountry.framework",
361 "${BUILT_PRODUCTS_DIR}/CNLiveCommonCategory/CNLiveCommonCategory.framework", 361 "${BUILT_PRODUCTS_DIR}/CNLiveCommonCategory/CNLiveCommonCategory.framework",
362 "${BUILT_PRODUCTS_DIR}/CNLiveCommonClass/CNLiveCommonClass.framework", 362 "${BUILT_PRODUCTS_DIR}/CNLiveCommonClass/CNLiveCommonClass.framework",
  363 + "${BUILT_PRODUCTS_DIR}/CNLiveCustomControl/CNLiveCustomControl.framework",
363 "${BUILT_PRODUCTS_DIR}/CNLiveEnvironment/CNLiveEnvironment.framework", 364 "${BUILT_PRODUCTS_DIR}/CNLiveEnvironment/CNLiveEnvironment.framework",
364 "${BUILT_PRODUCTS_DIR}/CNLiveImagePickerController/CNLiveImagePickerController.framework", 365 "${BUILT_PRODUCTS_DIR}/CNLiveImagePickerController/CNLiveImagePickerController.framework",
365 "${BUILT_PRODUCTS_DIR}/CNLiveManager/CNLiveManager.framework", 366 "${BUILT_PRODUCTS_DIR}/CNLiveManager/CNLiveManager.framework",
@@ -389,6 +390,7 @@ @@ -389,6 +390,7 @@
389 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveChooseCountry.framework", 390 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveChooseCountry.framework",
390 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCommonCategory.framework", 391 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCommonCategory.framework",
391 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCommonClass.framework", 392 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCommonClass.framework",
  393 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCustomControl.framework",
392 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveEnvironment.framework", 394 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveEnvironment.framework",
393 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveImagePickerController.framework", 395 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveImagePickerController.framework",
394 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveManager.framework", 396 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveManager.framework",