Commit ddd6c8e6a0df8ebd524a05a332fe56f4aa3b7302

Authored by zhangxiaowen
1 parent efe12615

no message

CNLiveIntegralModule.podspec
@@ -97,5 +97,8 @@ TODO: 网家家-积分模块. @@ -97,5 +97,8 @@ TODO: 网家家-积分模块.
97 97
98 # 管理类 98 # 管理类
99 s.dependency 'CNLiveManager' 99 s.dependency 'CNLiveManager'
  100 +
  101 + #类别
  102 + s.dependency 'CNLiveCategory'
100 103
101 end 104 end
CNLiveIntegralModule/Classes/Controller/CNLiveTaskListController.m
@@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
17 #import "CNLiveNetworking.h" 17 #import "CNLiveNetworking.h"
18 #import "CNLiveEnvironment.h" 18 #import "CNLiveEnvironment.h"
19 #import "CNUserInfoManager.h" 19 #import "CNUserInfoManager.h"
  20 +#import "CNLiveCategory.h"
20 21
21 #import "CNLiveTaskListTableViewCell.h" 22 #import "CNLiveTaskListTableViewCell.h"
22 #import "CNLiveTaskListSectionHeaderView.h" 23 #import "CNLiveTaskListSectionHeaderView.h"
@@ -324,7 +325,7 @@ @@ -324,7 +325,7 @@
324 _backButton.adjustsImageWhenHighlighted = NO; 325 _backButton.adjustsImageWhenHighlighted = NO;
325 _backButton.frame = CGRectMake(15, StatusBarHeight, 44, 44); 326 _backButton.frame = CGRectMake(15, StatusBarHeight, 44, 44);
326 [_backButton setContentHorizontalAlignment:UIControlContentHorizontalAlignmentLeft]; 327 [_backButton setContentHorizontalAlignment:UIControlContentHorizontalAlignmentLeft];
327 - UIImage *image = [self xw_getImageName:@"mine_back_white_b" bundleName:@"CNLiveIntegralModule" targetClass:[self class]]; 328 + UIImage *image = [UIImage cn_getImageName:@"mine_back_white_b" bundleName:@"CNLiveIntegralModule" targetClass:[self class]];
328 [_backButton setImage:image forState:UIControlStateNormal]; 329 [_backButton setImage:image forState:UIControlStateNormal];
329 [_backButton addTarget:self action:@selector(backAction:) forControlEvents:UIControlEventTouchUpInside]; 330 [_backButton addTarget:self action:@selector(backAction:) forControlEvents:UIControlEventTouchUpInside];
330 } 331 }
@@ -370,7 +371,7 @@ @@ -370,7 +371,7 @@
370 - (CNLiveTaskListHeaderView *)headView{ 371 - (CNLiveTaskListHeaderView *)headView{
371 if (!_headView) { 372 if (!_headView) {
372 _headView = [[CNLiveTaskListHeaderView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, NavigationContentTop+SCREEN_WIDTH*100/375.0)]; 373 _headView = [[CNLiveTaskListHeaderView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, NavigationContentTop+SCREEN_WIDTH*100/375.0)];
373 - UIImage *image = [self xw_getImageName:@"integrate_list_bg" bundleName:@"CNLiveIntegralModule" targetClass:[CNLiveTaskListController class]]; 374 + UIImage *image = [UIImage cn_getImageName:@"integrate_list_bg" bundleName:@"CNLiveIntegralModule" targetClass:[CNLiveTaskListController class]];
374 _headView.image = image; 375 _headView.image = image;
375 _headView.delegate = self; 376 _headView.delegate = self;
376 } 377 }
@@ -385,20 +386,5 @@ @@ -385,20 +386,5 @@
385 return UIStatusBarStyleLightContent; 386 return UIStatusBarStyleLightContent;
386 } 387 }
387 388
388 -/**  
389 - * 创建图片  
390 - *  
391 - * @param imageName 图片名字  
392 - * @param bundleName 图片所在的bundle名字  
393 - * @param targetClass 类和bundle的同级目录  
394 - * @return 返回UIImage  
395 - */  
396 -- (UIImage *)xw_getImageName:(NSString *)imageName bundleName:(NSString *)bundleName targetClass:(Class)targetClass{  
397 - NSBundle *bundle = [NSBundle bundleForClass:targetClass];  
398 - NSURL *url = [bundle URLForResource:bundleName withExtension:@"bundle"];  
399 - NSBundle *targetBundle = [NSBundle bundleWithURL:url];  
400 - UIImage *image = [UIImage imageNamed:imageName inBundle:targetBundle compatibleWithTraitCollection:nil];  
401 - return image?image:[UIImage imageNamed:imageName inBundle:[NSBundle mainBundle] compatibleWithTraitCollection:nil];  
402 -}  
403 389
404 @end 390 @end
CNLiveIntegralModule/Classes/Tools/CNLiveAddScoreView.m
@@ -15,6 +15,7 @@ @@ -15,6 +15,7 @@
15 15
16 #import "CNLiveIntegralServiceProtocol.h" 16 #import "CNLiveIntegralServiceProtocol.h"
17 #import "NSString+CNLiveExtension.h" 17 #import "NSString+CNLiveExtension.h"
  18 +#import "CNLiveCategory.h"
18 19
19 #import "CNLiveGoldWhereaboutsView.h" 20 #import "CNLiveGoldWhereaboutsView.h"
20 21
@@ -262,7 +263,7 @@ @@ -262,7 +263,7 @@
262 if (!_midImage) { 263 if (!_midImage) {
263 _midImage = [[UIImageView alloc] init]; 264 _midImage = [[UIImageView alloc] init];
264 _midImage.userInteractionEnabled = YES; 265 _midImage.userInteractionEnabled = YES;
265 - UIImage *image = [self xw_getImageName:@"add_score_bg" bundleName:@"CNLiveIntegralModule" targetClass:[self class]]; 266 + UIImage *image = [UIImage cn_getImageName:@"add_score_bg" bundleName:@"CNLiveIntegralModule" targetClass:[self class]];
266 _midImage.image = image; 267 _midImage.image = image;
267 _midImage.contentMode = UIViewContentModeCenter; 268 _midImage.contentMode = UIViewContentModeCenter;
268 } 269 }
@@ -272,7 +273,7 @@ @@ -272,7 +273,7 @@
272 if (!_scoreBtn) { 273 if (!_scoreBtn) {
273 _scoreBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 274 _scoreBtn = [UIButton buttonWithType:UIButtonTypeCustom];
274 _scoreBtn.adjustsImageWhenHighlighted = NO; 275 _scoreBtn.adjustsImageWhenHighlighted = NO;
275 - UIImage *image = [self xw_getImageName:@"add_score_label" bundleName:@"CNLiveIntegralModule" targetClass:[self class]]; 276 + UIImage *image = [UIImage cn_getImageName:@"add_score_label" bundleName:@"CNLiveIntegralModule" targetClass:[self class]];
276 [_scoreBtn setImage:image forState:UIControlStateNormal]; 277 [_scoreBtn setImage:image forState:UIControlStateNormal];
277 [_scoreBtn addTarget:self action:@selector(clickedCloseBtn:) forControlEvents:UIControlEventTouchUpInside]; 278 [_scoreBtn addTarget:self action:@selector(clickedCloseBtn:) forControlEvents:UIControlEventTouchUpInside];
278 279
@@ -295,7 +296,7 @@ @@ -295,7 +296,7 @@
295 if(!_colseBtn){ 296 if(!_colseBtn){
296 _colseBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 297 _colseBtn = [UIButton buttonWithType:UIButtonTypeCustom];
297 [_colseBtn addTarget:self action:@selector(clickedClose) forControlEvents:UIControlEventTouchUpInside]; 298 [_colseBtn addTarget:self action:@selector(clickedClose) forControlEvents:UIControlEventTouchUpInside];
298 - UIImage *image = [self xw_getImageName:@"add_score_close" bundleName:@"CNLiveIntegralModule" targetClass:[self class]]; 299 + UIImage *image = [UIImage cn_getImageName:@"add_score_close" bundleName:@"CNLiveIntegralModule" targetClass:[self class]];
299 [_colseBtn setImage:image forState:UIControlStateNormal]; 300 [_colseBtn setImage:image forState:UIControlStateNormal];
300 301
301 } 302 }
@@ -315,20 +316,5 @@ @@ -315,20 +316,5 @@
315 return _descLabel; 316 return _descLabel;
316 } 317 }
317 318
318 -/**  
319 - * 创建图片  
320 - *  
321 - * @param imageName 图片名字  
322 - * @param bundleName 图片所在的bundle名字  
323 - * @param targetClass 类和bundle的同级目录  
324 - * @return 返回UIImage  
325 - */  
326 -- (UIImage *)xw_getImageName:(NSString *)imageName bundleName:(NSString *)bundleName targetClass:(Class)targetClass{  
327 - NSBundle *bundle = [NSBundle bundleForClass:targetClass];  
328 - NSURL *url = [bundle URLForResource:bundleName withExtension:@"bundle"];  
329 - NSBundle *targetBundle = [NSBundle bundleWithURL:url];  
330 - UIImage *image = [UIImage imageNamed:imageName inBundle:targetBundle compatibleWithTraitCollection:nil];  
331 - return image?image:[UIImage imageNamed:imageName inBundle:[NSBundle mainBundle] compatibleWithTraitCollection:nil];  
332 -}  
333 319
334 @end 320 @end
CNLiveIntegralModule/Classes/Tools/CNLiveGoldWhereaboutsView.m
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 //#import "CNAudioOrVideoMananger.h" 12 //#import "CNAudioOrVideoMananger.h"
13 //#import "CNAudioPlayerManager.h" 13 //#import "CNAudioPlayerManager.h"
14 //#import "LVCPlayer.h" 14 //#import "LVCPlayer.h"
15 - 15 +#import "CNLiveCategory.h"
16 #import "CNLiveIntegralServiceProtocol.h" 16 #import "CNLiveIntegralServiceProtocol.h"
17 17
18 #import "CNLiveAddScoreView.h" 18 #import "CNLiveAddScoreView.h"
@@ -88,7 +88,7 @@ @@ -88,7 +88,7 @@
88 snowFlake.emissionRange = 0.5 * M_PI; 88 snowFlake.emissionRange = 0.5 * M_PI;
89 snowFlake.spinRange = 0.25 * M_PI; 89 snowFlake.spinRange = 0.25 * M_PI;
90 90
91 - UIImage *image = [self xw_getImageName:[NSString stringWithFormat:@"gold_whereabouts%d",i] bundleName:@"CNLiveIntegralModule" targetClass:[self class]]; 91 + UIImage *image = [UIImage cn_getImageName:[NSString stringWithFormat:@"gold_whereabouts%d",i] bundleName:@"CNLiveIntegralModule" targetClass:[self class]];
92 snowFlake.contents = (__bridge id _Nullable)(image.CGImage); 92 snowFlake.contents = (__bridge id _Nullable)(image.CGImage);
93 snowFlake.lifetime = 100.f; 93 snowFlake.lifetime = 100.f;
94 94
@@ -248,20 +248,4 @@ @@ -248,20 +248,4 @@
248 [self hide]; 248 [self hide];
249 } 249 }
250 250
251 -/**  
252 - * 创建图片  
253 - *  
254 - * @param imageName 图片名字  
255 - * @param bundleName 图片所在的bundle名字  
256 - * @param targetClass 类和bundle的同级目录  
257 - * @return 返回UIImage  
258 - */  
259 -- (UIImage *)xw_getImageName:(NSString *)imageName bundleName:(NSString *)bundleName targetClass:(Class)targetClass{  
260 - NSBundle *bundle = [NSBundle bundleForClass:targetClass];  
261 - NSURL *url = [bundle URLForResource:bundleName withExtension:@"bundle"];  
262 - NSBundle *targetBundle = [NSBundle bundleWithURL:url];  
263 - UIImage *image = [UIImage imageNamed:imageName inBundle:targetBundle compatibleWithTraitCollection:nil];  
264 - return image?image:[UIImage imageNamed:imageName inBundle:[NSBundle mainBundle] compatibleWithTraitCollection:nil];  
265 -}  
266 -  
267 @end 251 @end
CNLiveIntegralModule/Classes/Tools/CNLiveSignInView.m
@@ -11,6 +11,7 @@ @@ -11,6 +11,7 @@
11 #import "YYKit.h" 11 #import "YYKit.h"
12 #import <Masonry/Masonry.h> 12 #import <Masonry/Masonry.h>
13 #import <SDWebImage/SDWebImage.h> 13 #import <SDWebImage/SDWebImage.h>
  14 +#import "CNLiveCategory.h"
14 15
15 #import "CNLiveIntegralServiceProtocol.h" 16 #import "CNLiveIntegralServiceProtocol.h"
16 17
@@ -195,7 +196,7 @@ static const NSInteger margin = 15; @@ -195,7 +196,7 @@ static const NSInteger margin = 15;
195 if (!_bgView) { 196 if (!_bgView) {
196 _bgView = [[UIImageView alloc] init]; 197 _bgView = [[UIImageView alloc] init];
197 _bgView.userInteractionEnabled = YES; 198 _bgView.userInteractionEnabled = YES;
198 - UIImage *image = [self xw_getImageName:@"sign_allday_bg" bundleName:@"CNLiveIntegralModule" targetClass:[self class]]; 199 + UIImage *image = [UIImage cn_getImageName:@"sign_allday_bg" bundleName:@"CNLiveIntegralModule" targetClass:[self class]];
199 _bgView.image = image; 200 _bgView.image = image;
200 } 201 }
201 return _bgView; 202 return _bgView;
@@ -206,7 +207,7 @@ static const NSInteger margin = 15; @@ -206,7 +207,7 @@ static const NSInteger margin = 15;
206 _scoreBtn.titleLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:20]; 207 _scoreBtn.titleLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:20];
207 // [_scoreBtn addTarget:self action:@selector(clickScoreBtn:) forControlEvents:UIControlEventTouchUpInside]; 208 // [_scoreBtn addTarget:self action:@selector(clickScoreBtn:) forControlEvents:UIControlEventTouchUpInside];
208 [_scoreBtn setTitle:@"+0" forState:UIControlStateNormal]; 209 [_scoreBtn setTitle:@"+0" forState:UIControlStateNormal];
209 - UIImage *image = [self xw_getImageName:@"sign_in_soccer" bundleName:@"CNLiveIntegralModule" targetClass:[self class]]; 210 + UIImage *image = [UIImage cn_getImageName:@"sign_in_soccer" bundleName:@"CNLiveIntegralModule" targetClass:[self class]];
210 [_scoreBtn setImage:image forState:UIControlStateNormal]; 211 [_scoreBtn setImage:image forState:UIControlStateNormal];
211 [_scoreBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 212 [_scoreBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
212 _scoreBtn.adjustsImageWhenHighlighted = NO; 213 _scoreBtn.adjustsImageWhenHighlighted = NO;
@@ -243,7 +244,7 @@ static const NSInteger margin = 15; @@ -243,7 +244,7 @@ static const NSInteger margin = 15;
243 _closeBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 244 _closeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
244 _closeBtn.titleLabel.font = UIFontMake(12); 245 _closeBtn.titleLabel.font = UIFontMake(12);
245 [_closeBtn addTarget:self action:@selector(clickCloseBtn:) forControlEvents:UIControlEventTouchUpInside]; 246 [_closeBtn addTarget:self action:@selector(clickCloseBtn:) forControlEvents:UIControlEventTouchUpInside];
246 - UIImage *image = [self xw_getImageName:@"sign_day_close" bundleName:@"CNLiveIntegralModule" targetClass:[self class]]; 247 + UIImage *image = [UIImage cn_getImageName:@"sign_day_close" bundleName:@"CNLiveIntegralModule" targetClass:[self class]];
247 [_closeBtn setImage:image forState:UIControlStateNormal]; 248 [_closeBtn setImage:image forState:UIControlStateNormal];
248 _closeBtn.adjustsImageWhenHighlighted = NO; 249 _closeBtn.adjustsImageWhenHighlighted = NO;
249 250
@@ -252,20 +253,4 @@ static const NSInteger margin = 15; @@ -252,20 +253,4 @@ static const NSInteger margin = 15;
252 253
253 } 254 }
254 255
255 -/**  
256 - * 创建图片  
257 - *  
258 - * @param imageName 图片名字  
259 - * @param bundleName 图片所在的bundle名字  
260 - * @param targetClass 类和bundle的同级目录  
261 - * @return 返回UIImage  
262 - */  
263 -- (UIImage *)xw_getImageName:(NSString *)imageName bundleName:(NSString *)bundleName targetClass:(Class)targetClass{  
264 - NSBundle *bundle = [NSBundle bundleForClass:targetClass];  
265 - NSURL *url = [bundle URLForResource:bundleName withExtension:@"bundle"];  
266 - NSBundle *targetBundle = [NSBundle bundleWithURL:url];  
267 - UIImage *image = [UIImage imageNamed:imageName inBundle:targetBundle compatibleWithTraitCollection:nil];  
268 - return image?image:[UIImage imageNamed:imageName inBundle:[NSBundle mainBundle] compatibleWithTraitCollection:nil];  
269 -}  
270 -  
271 @end 256 @end
CNLiveIntegralModule/Classes/View/CNLiveIntegralDetailsTableViewCell.m
@@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
10 #import "QMUIKit.h" 10 #import "QMUIKit.h"
11 #import <Masonry/Masonry.h> 11 #import <Masonry/Masonry.h>
12 #import <SDWebImage/SDWebImage.h> 12 #import <SDWebImage/SDWebImage.h>
  13 +#import "CNLiveCategory.h"
13 14
14 #import "CNLiveScoreModel.h" 15 #import "CNLiveScoreModel.h"
15 16
@@ -123,7 +124,7 @@ static const NSInteger margin = 15; @@ -123,7 +124,7 @@ static const NSInteger margin = 15;
123 _scoresBtn = [QMUIButton buttonWithType:UIButtonTypeCustom]; 124 _scoresBtn = [QMUIButton buttonWithType:UIButtonTypeCustom];
124 _scoresBtn.titleLabel.font = UIFontMake(14); 125 _scoresBtn.titleLabel.font = UIFontMake(14);
125 [_scoresBtn setTitleColor:[UIColor colorWithRed:249/255.0 green:171/255.0 blue:37/255.0 alpha:1.0] forState:UIControlStateNormal]; 126 [_scoresBtn setTitleColor:[UIColor colorWithRed:249/255.0 green:171/255.0 blue:37/255.0 alpha:1.0] forState:UIControlStateNormal];
126 - UIImage *image = [self xw_getImageName:@"mf_soccer_smallcoin" bundleName:@"CNLiveIntegralModule" targetClass:[self class]]; 127 + UIImage *image = [UIImage cn_getImageName:@"mf_soccer_smallcoin" bundleName:@"CNLiveIntegralModule" targetClass:[self class]];
127 [_scoresBtn setImage:image forState:UIControlStateNormal]; 128 [_scoresBtn setImage:image forState:UIControlStateNormal];
128 _scoresBtn.adjustsImageWhenHighlighted = NO; 129 _scoresBtn.adjustsImageWhenHighlighted = NO;
129 _scoresBtn.spacingBetweenImageAndTitle = 5; 130 _scoresBtn.spacingBetweenImageAndTitle = 5;
@@ -142,21 +143,4 @@ static const NSInteger margin = 15; @@ -142,21 +143,4 @@ static const NSInteger margin = 15;
142 143
143 } 144 }
144 145
145 -/**  
146 - * 创建图片  
147 - *  
148 - * @param imageName 图片名字  
149 - * @param bundleName 图片所在的bundle名字  
150 - * @param targetClass 类和bundle的同级目录  
151 - * @return 返回UIImage  
152 - */  
153 -- (UIImage *)xw_getImageName:(NSString *)imageName bundleName:(NSString *)bundleName targetClass:(Class)targetClass{  
154 - NSBundle *bundle = [NSBundle bundleForClass:targetClass];  
155 - NSURL *url = [bundle URLForResource:bundleName withExtension:@"bundle"];  
156 - NSBundle *targetBundle = [NSBundle bundleWithURL:url];  
157 - UIImage *image = [UIImage imageNamed:imageName inBundle:targetBundle compatibleWithTraitCollection:nil];  
158 - return image?image:[UIImage imageNamed:imageName inBundle:[NSBundle mainBundle] compatibleWithTraitCollection:nil];  
159 -  
160 -}  
161 -  
162 @end 146 @end
CNLiveIntegralModule/Classes/View/CNLiveIntegralNavigationBar.m
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 8
9 #import "CNLiveIntegralNavigationBar.h" 9 #import "CNLiveIntegralNavigationBar.h"
10 #import "QMUIKit.h" 10 #import "QMUIKit.h"
  11 +#import "CNLiveCategory.h"
11 12
12 @interface CNLiveIntegralNavigationBar () 13 @interface CNLiveIntegralNavigationBar ()
13 14
@@ -59,7 +60,7 @@ static const NSInteger margin = 15; @@ -59,7 +60,7 @@ static const NSInteger margin = 15;
59 _left= [UIButton buttonWithType:UIButtonTypeCustom]; 60 _left= [UIButton buttonWithType:UIButtonTypeCustom];
60 _left.adjustsImageWhenHighlighted = NO; 61 _left.adjustsImageWhenHighlighted = NO;
61 _left.frame = CGRectMake(margin, StatusBarHeight, NavigationBarHeight, NavigationBarHeight); 62 _left.frame = CGRectMake(margin, StatusBarHeight, NavigationBarHeight, NavigationBarHeight);
62 - UIImage *image = [self xw_getImageName:@"code_back_black_b" bundleName:@"CNLiveIntegralModule" targetClass:[self class]]; 63 + UIImage *image = [UIImage cn_getImageName:@"code_back_black_b" bundleName:@"CNLiveIntegralModule" targetClass:[self class]];
63 [_left setImage:[image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal]; 64 [_left setImage:[image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
64 [_left setContentHorizontalAlignment:UIControlContentHorizontalAlignmentLeft]; 65 [_left setContentHorizontalAlignment:UIControlContentHorizontalAlignmentLeft];
65 [_left addTarget:self action:@selector(goBack) forControlEvents:UIControlEventTouchUpInside]; 66 [_left addTarget:self action:@selector(goBack) forControlEvents:UIControlEventTouchUpInside];
@@ -103,22 +104,5 @@ static const NSInteger margin = 15; @@ -103,22 +104,5 @@ static const NSInteger margin = 15;
103 } 104 }
104 } 105 }
105 106
106 -/**  
107 - * 创建图片  
108 - *  
109 - * @param imageName 图片名字  
110 - * @param bundleName 图片所在的bundle名字  
111 - * @param targetClass 类和bundle的同级目录  
112 - * @return 返回UIImage  
113 - */  
114 -- (UIImage *)xw_getImageName:(NSString *)imageName bundleName:(NSString *)bundleName targetClass:(Class)targetClass{  
115 - NSBundle *bundle = [NSBundle bundleForClass:targetClass];  
116 - NSURL *url = [bundle URLForResource:bundleName withExtension:@"bundle"];  
117 - NSBundle *targetBundle = [NSBundle bundleWithURL:url];  
118 - UIImage *image = [UIImage imageNamed:imageName inBundle:targetBundle compatibleWithTraitCollection:nil];  
119 - return image?image:[UIImage imageNamed:imageName inBundle:[NSBundle mainBundle] compatibleWithTraitCollection:nil];  
120 -  
121 -}  
122 -  
123 @end 107 @end
124 108
CNLiveIntegralModule/Classes/View/CNLiveSignInButtonSelectView.m
@@ -7,6 +7,8 @@ @@ -7,6 +7,8 @@
7 // 7 //
8 8
9 #import "CNLiveSignInButtonSelectView.h" 9 #import "CNLiveSignInButtonSelectView.h"
  10 +#import "CNLiveCategory.h"
  11 +
10 @interface CNLiveSignInButtonSelectView() 12 @interface CNLiveSignInButtonSelectView()
11 @property (nonatomic, strong) UIImageView *selectView; 13 @property (nonatomic, strong) UIImageView *selectView;
12 14
@@ -36,26 +38,10 @@ @@ -36,26 +38,10 @@
36 _selectView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 27, 27)]; 38 _selectView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 27, 27)];
37 _selectView.center = self.center; 39 _selectView.center = self.center;
38 _selectView.userInteractionEnabled = YES; 40 _selectView.userInteractionEnabled = YES;
39 - UIImage *image = [self xw_getImageName:@"sign_day_select" bundleName:@"CNLiveIntegralModule" targetClass:[self class]]; 41 + UIImage *image = [UIImage cn_getImageName:@"sign_day_select" bundleName:@"CNLiveIntegralModule" targetClass:[self class]];
40 _selectView.image = image; 42 _selectView.image = image;
41 } 43 }
42 return _selectView; 44 return _selectView;
43 } 45 }
44 46
45 -/**  
46 - * 创建图片  
47 - *  
48 - * @param imageName 图片名字  
49 - * @param bundleName 图片所在的bundle名字  
50 - * @param targetClass 类和bundle的同级目录  
51 - * @return 返回UIImage  
52 - */  
53 -- (UIImage *)xw_getImageName:(NSString *)imageName bundleName:(NSString *)bundleName targetClass:(Class)targetClass{  
54 - NSBundle *bundle = [NSBundle bundleForClass:targetClass];  
55 - NSURL *url = [bundle URLForResource:bundleName withExtension:@"bundle"];  
56 - NSBundle *targetBundle = [NSBundle bundleWithURL:url];  
57 - UIImage *image = [UIImage imageNamed:imageName inBundle:targetBundle compatibleWithTraitCollection:nil];  
58 - return image?image:[UIImage imageNamed:imageName inBundle:[NSBundle mainBundle] compatibleWithTraitCollection:nil];  
59 -}  
60 -  
61 @end 47 @end
CNLiveIntegralModule/Classes/View/CNLiveSignInButtonView.m
@@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
10 10
11 #import "QMUIKit.h" 11 #import "QMUIKit.h"
12 #import "YYKit.h" 12 #import "YYKit.h"
  13 +#import "CNLiveCategory.h"
13 14
14 #import "CNLiveSignInButtonSelectView.h" 15 #import "CNLiveSignInButtonSelectView.h"
15 16
@@ -38,7 +39,7 @@ static const NSInteger margin = 6; @@ -38,7 +39,7 @@ static const NSInteger margin = 6;
38 btn.frame = CGRectMake(i<4?i*(width+margin):(i-4)*(width+margin), i<4?0:(margin+height), width, height); 39 btn.frame = CGRectMake(i<4?i*(width+margin):(i-4)*(width+margin), i<4?0:(margin+height), width, height);
39 40
40 [btn addTarget:self action:@selector(clickBtn:) forControlEvents:UIControlEventTouchUpInside]; 41 [btn addTarget:self action:@selector(clickBtn:) forControlEvents:UIControlEventTouchUpInside];
41 - UIImage *image = [self xw_getImageName:@"sign_day_bg" bundleName:@"CNLiveIntegralModule" targetClass:[self class]]; 42 + UIImage *image = [UIImage cn_getImageName:@"sign_day_bg" bundleName:@"CNLiveIntegralModule" targetClass:[self class]];
42 [btn setImage:image forState:UIControlStateNormal]; 43 [btn setImage:image forState:UIControlStateNormal];
43 btn.adjustsImageWhenHighlighted = NO; 44 btn.adjustsImageWhenHighlighted = NO;
44 btn.userInteractionEnabled = NO; 45 btn.userInteractionEnabled = NO;
@@ -47,7 +48,7 @@ static const NSInteger margin = 6; @@ -47,7 +48,7 @@ static const NSInteger margin = 6;
47 48
48 if(i == 6){ 49 if(i == 6){
49 btn.width = 2*width+margin; 50 btn.width = 2*width+margin;
50 - UIImage *image = [self xw_getImageName:@"sign_day_bg7" bundleName:@"CNLiveIntegralModule" targetClass:[self class]]; 51 + UIImage *image = [UIImage cn_getImageName:@"sign_day_bg7" bundleName:@"CNLiveIntegralModule" targetClass:[self class]];
51 [btn setImage:image forState:UIControlStateNormal]; 52 [btn setImage:image forState:UIControlStateNormal];
52 53
53 } 54 }
@@ -144,21 +145,4 @@ static const NSInteger margin = 6; @@ -144,21 +145,4 @@ static const NSInteger margin = 6;
144 return _btnsArr; 145 return _btnsArr;
145 } 146 }
146 147
147 -/**  
148 - * 创建图片  
149 - *  
150 - * @param imageName 图片名字  
151 - * @param bundleName 图片所在的bundle名字  
152 - * @param targetClass 类和bundle的同级目录  
153 - * @return 返回UIImage  
154 - */  
155 -- (UIImage *)xw_getImageName:(NSString *)imageName bundleName:(NSString *)bundleName targetClass:(Class)targetClass{  
156 - NSBundle *bundle = [NSBundle bundleForClass:targetClass];  
157 - NSURL *url = [bundle URLForResource:bundleName withExtension:@"bundle"];  
158 - NSBundle *targetBundle = [NSBundle bundleWithURL:url];  
159 - UIImage *image = [UIImage imageNamed:imageName inBundle:targetBundle compatibleWithTraitCollection:nil];  
160 - return image?image:[UIImage imageNamed:imageName inBundle:[NSBundle mainBundle] compatibleWithTraitCollection:nil];  
161 -  
162 -}  
163 -  
164 @end 148 @end
CNLiveIntegralModule/Classes/View/CNLiveTaskListHeaderView.m
@@ -12,6 +12,7 @@ @@ -12,6 +12,7 @@
12 #import <SDWebImage/SDWebImage.h> 12 #import <SDWebImage/SDWebImage.h>
13 13
14 #import "CNUserInfoManager.h" 14 #import "CNUserInfoManager.h"
  15 +#import "CNLiveCategory.h"
15 16
16 @interface CNLiveTaskListHeaderView() 17 @interface CNLiveTaskListHeaderView()
17 @property (nonatomic, strong) UIImageView *headView; 18 @property (nonatomic, strong) UIImageView *headView;
@@ -101,7 +102,7 @@ static const NSInteger margin = 15; @@ -101,7 +102,7 @@ static const NSInteger margin = 15;
101 _headView.layer.masksToBounds = YES; 102 _headView.layer.masksToBounds = YES;
102 _headView.layer.borderColor = [UIColor whiteColor].CGColor; 103 _headView.layer.borderColor = [UIColor whiteColor].CGColor;
103 _headView.layer.borderWidth = 1.5; 104 _headView.layer.borderWidth = 1.5;
104 - UIImage *xw_image = [self xw_getImageName:@"default_avatar_f" bundleName:@"CNLiveIntegralModule" targetClass:[self class]]; 105 + UIImage *xw_image = [UIImage cn_getImageName:@"default_avatar_f" bundleName:@"CNLiveIntegralModule" targetClass:[self class]];
105 [_headView sd_setImageWithURL:[NSURL URLWithString:CNUserShareModel.faceUrl] placeholderImage:xw_image]; 106 [_headView sd_setImageWithURL:[NSURL URLWithString:CNUserShareModel.faceUrl] placeholderImage:xw_image];
106 107
107 } 108 }
@@ -137,7 +138,7 @@ static const NSInteger margin = 15; @@ -137,7 +138,7 @@ static const NSInteger margin = 15;
137 _detailBtn.titleLabel.font = UIFontMake(12); 138 _detailBtn.titleLabel.font = UIFontMake(12);
138 [_detailBtn addTarget:self action:@selector(clickedDetailButton:) forControlEvents:UIControlEventTouchUpInside]; 139 [_detailBtn addTarget:self action:@selector(clickedDetailButton:) forControlEvents:UIControlEventTouchUpInside];
139 [_detailBtn setTitle:@"明细" forState:UIControlStateNormal]; 140 [_detailBtn setTitle:@"明细" forState:UIControlStateNormal];
140 - UIImage *image = [self xw_getImageName:@"integrate_next_white" bundleName:@"CNLiveIntegralModule" targetClass:[self class]]; 141 + UIImage *image = [UIImage cn_getImageName:@"integrate_next_white" bundleName:@"CNLiveIntegralModule" targetClass:[self class]];
141 [_detailBtn setImage:image forState:UIControlStateNormal]; 142 [_detailBtn setImage:image forState:UIControlStateNormal];
142 [_detailBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 143 [_detailBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
143 _detailBtn.spacingBetweenImageAndTitle = 5; 144 _detailBtn.spacingBetweenImageAndTitle = 5;
@@ -147,20 +148,4 @@ static const NSInteger margin = 15; @@ -147,20 +148,4 @@ static const NSInteger margin = 15;
147 148
148 } 149 }
149 150
150 -/**  
151 - * 创建图片  
152 - *  
153 - * @param imageName 图片名字  
154 - * @param bundleName 图片所在的bundle名字  
155 - * @param targetClass 类和bundle的同级目录  
156 - * @return 返回UIImage  
157 - */  
158 -- (UIImage *)xw_getImageName:(NSString *)imageName bundleName:(NSString *)bundleName targetClass:(Class)targetClass{  
159 - NSBundle *bundle = [NSBundle bundleForClass:targetClass];  
160 - NSURL *url = [bundle URLForResource:bundleName withExtension:@"bundle"];  
161 - NSBundle *targetBundle = [NSBundle bundleWithURL:url];  
162 - UIImage *image = [UIImage imageNamed:imageName inBundle:targetBundle compatibleWithTraitCollection:nil];  
163 - return image?image:[UIImage imageNamed:imageName inBundle:[NSBundle mainBundle] compatibleWithTraitCollection:nil];  
164 -}  
165 -  
166 @end 151 @end
Example/CNLiveIntegralModule.xcodeproj/project.pbxproj
@@ -330,6 +330,7 @@ @@ -330,6 +330,7 @@
330 "${BUILT_PRODUCTS_DIR}/AFNetworking/AFNetworking.framework", 330 "${BUILT_PRODUCTS_DIR}/AFNetworking/AFNetworking.framework",
331 "${BUILT_PRODUCTS_DIR}/CNLiveBaseKit/CNLiveBaseKit.framework", 331 "${BUILT_PRODUCTS_DIR}/CNLiveBaseKit/CNLiveBaseKit.framework",
332 "${BUILT_PRODUCTS_DIR}/CNLiveBeeHive/CNLiveBeeHive.framework", 332 "${BUILT_PRODUCTS_DIR}/CNLiveBeeHive/CNLiveBeeHive.framework",
  333 + "${BUILT_PRODUCTS_DIR}/CNLiveCategory/CNLiveCategory.framework",
333 "${BUILT_PRODUCTS_DIR}/CNLiveCommonClass/CNLiveCommonClass.framework", 334 "${BUILT_PRODUCTS_DIR}/CNLiveCommonClass/CNLiveCommonClass.framework",
334 "${BUILT_PRODUCTS_DIR}/CNLiveEnvironment/CNLiveEnvironment.framework", 335 "${BUILT_PRODUCTS_DIR}/CNLiveEnvironment/CNLiveEnvironment.framework",
335 "${BUILT_PRODUCTS_DIR}/CNLiveIntegralModule/CNLiveIntegralModule.framework", 336 "${BUILT_PRODUCTS_DIR}/CNLiveIntegralModule/CNLiveIntegralModule.framework",
@@ -350,6 +351,7 @@ @@ -350,6 +351,7 @@
350 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AFNetworking.framework", 351 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AFNetworking.framework",
351 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBaseKit.framework", 352 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBaseKit.framework",
352 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBeeHive.framework", 353 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBeeHive.framework",
  354 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCategory.framework",
353 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCommonClass.framework", 355 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCommonClass.framework",
354 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveEnvironment.framework", 356 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveEnvironment.framework",
355 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveIntegralModule.framework", 357 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveIntegralModule.framework",