Commit 220d686c18418ee8f06f74ddadd73f4e13e59720

Authored by zhangxiaowen
1 parent 9b145d92

no message

CNLiveSettingModule.podspec
... ... @@ -153,6 +153,9 @@ TODO: 网家家-设置模块.
153 153  
154 154 # 管理类
155 155 s.dependency 'CNLiveManager'
  156 +
  157 + # 分类
  158 + s.dependency 'CNLiveCategory'
156 159  
157 160 s.static_framework = true
158 161  
... ...
CNLiveSettingModule/Classes/AboutUs/CNLiveAboutUsController.m
... ... @@ -13,6 +13,7 @@
13 13 #import "CNLiveServices.h"
14 14 #import "CNLiveUserAgreementManager.h"
15 15 #import "CNLiveEnvironment.h"
  16 +#import "CNLiveCategory.h"
16 17  
17 18 #import "CNLiveSettingModel.h"
18 19 #import "CNLiveSettingCell.h"
... ... @@ -259,7 +260,7 @@ static const NSInteger timeValue = 1.5;
259 260 _headerView.clipsToBounds = YES;
260 261 _headerView.backgroundColor = [UIColor colorWithRed:242/255.0 green:242/255.0 blue:242/255.0 alpha:1.0];
261 262 UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH-70)/2.0, 30, 70, 140)];
262   - UIImage *image = [self xw_getImageName:@"about_us_icon" bundleName:@"CNLiveSettingModule" targetClass:[CNLiveSettingNavigationBar class]];
  263 + UIImage *image = [UIImage cn_getImageName:@"about_us_icon" bundleName:@"CNLiveSettingModule" targetClass:[CNLiveSettingNavigationBar class]];
263 264 imageView.image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
264 265 imageView.contentMode = UIViewContentModeScaleAspectFill;
265 266 imageView.clipsToBounds = YES;
... ...
CNLiveSettingModule/Classes/Cancellation/CNLiveCancellationView.m
... ... @@ -9,6 +9,7 @@
9 9 #import "CNLiveCancellationView.h"
10 10 #import "YYKit.h"
11 11 #import <Masonry/Masonry.h>
  12 +#import "CNLiveCategory.h"
12 13  
13 14 @interface CNLiveCancellationView()<UITextViewDelegate>
14 15 @property (nonatomic, strong) UIButton *agreeBtn;
... ... @@ -105,9 +106,9 @@ static const NSInteger margin = 15;
105 106 - (UIButton *)agreeBtn{
106 107 if (!_agreeBtn) {
107 108 _agreeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
108   - UIImage *xw_image1 = [self xw_getImageName:@"cancellation_agree" bundleName:@"CNLiveSettingModule" targetClass:[CNLiveCancellationView class]];
  109 + UIImage *xw_image1 = [UIImage cn_getImageName:@"cancellation_agree" bundleName:@"CNLiveSettingModule" targetClass:[CNLiveCancellationView class]];
109 110  
110   - UIImage *xw_image2 = [self xw_getImageName:@"cancellation_agree_sel" bundleName:@"CNLiveSettingModule" targetClass:[CNLiveCancellationView class]];
  111 + UIImage *xw_image2 = [UIImage cn_getImageName:@"cancellation_agree_sel" bundleName:@"CNLiveSettingModule" targetClass:[CNLiveCancellationView class]];
111 112  
112 113 [_agreeBtn setImage:xw_image1 forState:UIControlStateNormal];
113 114 [_agreeBtn setImage:xw_image2 forState:UIControlStateSelected];
... ...
CNLiveSettingModule/Classes/FontSIze/CNLiveFontSettingCell.m
... ... @@ -10,6 +10,7 @@
10 10 #import <SDWebImage/SDWebImage.h>
11 11  
12 12 #import "CNLiveBaseKit.h"
  13 +#import "CNLiveCategory.h"
13 14  
14 15 #import "CNLiveFontSettingModel.h"
15 16 #import "CNLiveFontSettingFrame.h"
... ... @@ -49,7 +50,7 @@
49 50  
50 51 // 1.设置头像
51 52 self.headImage.frame = fontSettingFrame.iconFrame;
52   - UIImage *image = [self xw_getImageName:@"font_size_logo" bundleName:@"CNLiveSettingModule" targetClass:[self class]];
  53 + UIImage *image = [UIImage cn_getImageName:@"font_size_logo" bundleName:@"CNLiveSettingModule" targetClass:[self class]];
53 54 [_headImage sd_setImageWithURL:[NSURL URLWithString:model.icon] placeholderImage:image];
54 55  
55 56 // 2.设置内容
... ...
CNLiveSettingModule/Classes/FontSIze/CNLiveFontSettingContentButton.m
... ... @@ -8,6 +8,8 @@
8 8  
9 9 #import "CNLiveFontSettingContentButton.h"
10 10 #import "CNLiveBaseKit.h"
  11 +#import "CNLiveCategory.h"
  12 +
11 13 #import "CNLiveFontSettingFrame.h"
12 14 #import "CNLiveFontSettingModel.h"
13 15  
... ... @@ -35,11 +37,11 @@
35 37 CNLiveFontSettingModel *FontSetting = fontSettingFrame.model;
36 38  
37 39 if ([FontSetting.fromMe isEqualToString:@"1"]) {
38   - normal = [self xw_getImageName:@"font_size_message_me" bundleName:@"CNLiveSettingModule" targetClass:[self class]];
  40 + normal = [UIImage cn_getImageName:@"font_size_message_me" bundleName:@"CNLiveSettingModule" targetClass:[self class]];
39 41 normal = [normal stretchableImageWithLeftCapWidth:normal.size.width * 0.5 topCapHeight:normal.size.height * 0.9];
40 42 }
41 43 else{
42   - normal = [self xw_getImageName:@"font_size_message_other" bundleName:@"CNLiveSettingModule" targetClass:[self class]];
  44 + normal = [UIImage cn_getImageName:@"font_size_message_other" bundleName:@"CNLiveSettingModule" targetClass:[self class]];
43 45 normal = [normal stretchableImageWithLeftCapWidth:normal.size.width * 0.5 topCapHeight:normal.size.height * 0.9];
44 46 }
45 47  
... ...
CNLiveSettingModule/Classes/FontSIze/CNLiveFontSettingController.m
... ... @@ -11,6 +11,7 @@
11 11 #import "QMUIKit.h"
12 12 #import "CNLiveBaseKit.h"
13 13 #import "CNUserInfoManager.h"
  14 +#import "CNLiveCategory.h"
14 15  
15 16 #import "CNLiveSettingNavigationBar.h"
16 17 #import "CNLiveFontSettingFrame.h"
... ... @@ -118,7 +119,7 @@
118 119 //背景图
119 120 UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width-70-30, 8)];
120 121 imageView.center = self.slider.center;
121   - UIImage *image = [self xw_getImageName:@"font_size_slider" bundleName:@"CNLiveSettingModule" targetClass:[self class]];
  122 + UIImage *image = [UIImage cn_getImageName:@"font_size_slider" bundleName:@"CNLiveSettingModule" targetClass:[self class]];
122 123 imageView.image = image;
123 124 [bottomView addSubview:imageView];
124 125 [bottomView addSubview:self.slider];
... ...
CNLiveSettingModule/Classes/Privacy/CNLiveNotSeeCollectionViewCell.m
... ... @@ -10,6 +10,7 @@
10 10 #import <SDWebImage/SDWebImage.h>
11 11 #import "QMUIKit.h"
12 12 #import <Masonry/Masonry.h>
  13 +#import "CNLiveCategory.h"
13 14  
14 15 #import "CNLiveNotSeeModel.h"
15 16  
... ... @@ -37,14 +38,14 @@
37 38 if(model.type == CNLiveNotSeeModelTypeAdd){
38 39 _avatarImage.layer.masksToBounds = NO;
39 40 _avatarImage.layer.cornerRadius = 0;
40   - UIImage *xw_image = [self xw_getImageName:@"privacy_plus" bundleName:@"CNLiveSettingModule" targetClass:[CNLiveNotSeeCollectionViewCell class]];
  41 + UIImage *xw_image = [UIImage cn_getImageName:@"privacy_plus" bundleName:@"CNLiveSettingModule" targetClass:[CNLiveNotSeeCollectionViewCell class]];
41 42 [_avatarImage sd_setImageWithURL:[NSURL URLWithString:@""] placeholderImage:xw_image];
42 43 _nameLabel.text = @"";
43 44  
44 45 }else if (model.type == CNLiveNotSeeModelTypeMinus){
45 46 _avatarImage.layer.masksToBounds = NO;
46 47 _avatarImage.layer.cornerRadius = 0;
47   - UIImage *xw_image = [self xw_getImageName:@"privacy_less" bundleName:@"CNLiveSettingModule" targetClass:[CNLiveNotSeeCollectionViewCell class]];
  48 + UIImage *xw_image = [UIImage cn_getImageName:@"privacy_less" bundleName:@"CNLiveSettingModule" targetClass:[CNLiveNotSeeCollectionViewCell class]];
48 49 [_avatarImage sd_setImageWithURL:[NSURL URLWithString:@""] placeholderImage:xw_image];
49 50 _nameLabel.text = @"";
50 51  
... ... @@ -146,21 +147,4 @@
146 147 }
147 148 }
148 149  
149   -/**
150   - * 创建图片
151   - *
152   - * @param imageName 图片名字
153   - * @param bundleName 图片所在的bundle名字
154   - * @param targetClass 类和bundle的同级目录
155   - * @return 返回UIImage
156   - */
157   -- (UIImage *)xw_getImageName:(NSString *)imageName bundleName:(NSString *)bundleName targetClass:(Class)targetClass{
158   - NSBundle *bundle = [NSBundle bundleForClass:targetClass];
159   - NSURL *url = [bundle URLForResource:bundleName withExtension:@"bundle"];
160   - NSBundle *targetBundle = [NSBundle bundleWithURL:url];
161   - UIImage *image = [UIImage imageNamed:imageName inBundle:targetBundle compatibleWithTraitCollection:nil];
162   - return image?image:[UIImage imageNamed:imageName inBundle:[NSBundle mainBundle] compatibleWithTraitCollection:nil];
163   -
164   -}
165   -
166 150 @end
... ...
CNLiveSettingModule/Classes/Privacy/CNLivePrivacyContactTableViewCell.m
... ... @@ -9,6 +9,7 @@
9 9 #import "CNLivePrivacyContactTableViewCell.h"
10 10 #import <Masonry/Masonry.h>
11 11 #import "QMUIKit.h"
  12 +#import "CNLiveCategory.h"
12 13  
13 14 @interface CNLivePrivacyContactTableViewCell ()
14 15 @property (nonatomic, strong) UIImageView *iconImage;
... ... @@ -193,26 +194,10 @@
193 194  
194 195 - (UIImageView *)moreImage {
195 196 if (!_moreImage) {
196   - UIImage *xw_image = [self xw_getImageName:@"mine_info_front" bundleName:@"CNLiveSettingModule" targetClass:[CNLivePrivacyContactTableViewCell class]];
  197 + UIImage *xw_image = [UIImage cn_getImageName:@"mine_info_front" bundleName:@"CNLiveSettingModule" targetClass:[CNLivePrivacyContactTableViewCell class]];
197 198 _moreImage = [[UIImageView alloc] initWithImage:xw_image];
198 199 }
199 200 return _moreImage;
200 201 }
201 202  
202   -/**
203   - * 创建图片
204   - *
205   - * @param imageName 图片名字
206   - * @param bundleName 图片所在的bundle名字
207   - * @param targetClass 类和bundle的同级目录
208   - * @return 返回UIImage
209   - */
210   -- (UIImage *)xw_getImageName:(NSString *)imageName bundleName:(NSString *)bundleName targetClass:(Class)targetClass{
211   - NSBundle *bundle = [NSBundle bundleForClass:targetClass];
212   - NSURL *url = [bundle URLForResource:bundleName withExtension:@"bundle"];
213   - NSBundle *targetBundle = [NSBundle bundleWithURL:url];
214   - UIImage *image = [UIImage imageNamed:imageName inBundle:targetBundle compatibleWithTraitCollection:nil];
215   - return image?image:[UIImage imageNamed:imageName inBundle:[NSBundle mainBundle] compatibleWithTraitCollection:nil];
216   -}
217   -
218 203 @end
... ...
CNLiveSettingModule/Classes/Privacy/CNLivePrivacyTableViewCell.m
... ... @@ -14,6 +14,7 @@
14 14 #import "CNLiveNetworking.h"
15 15 #import "CNLiveEnvironment.h"
16 16 #import "CNUserInfoManager.h"
  17 +#import "CNLiveCategory.h"
17 18  
18 19 #import "CNLivePrivacyModel.h"
19 20  
... ... @@ -140,7 +141,7 @@ static const NSInteger margin = 12;
140 141 - (UIImageView *)arrowImage {
141 142 if (!_arrowImage) {
142 143 _arrowImage = [[UIImageView alloc] init];
143   - UIImage *xw_image = [self xw_getImageName:@"mine_info_front" bundleName:@"CNLiveSettingModule" targetClass:[CNLivePrivacyTableViewCell class]];
  144 + UIImage *xw_image = [UIImage cn_getImageName:@"mine_info_front" bundleName:@"CNLiveSettingModule" targetClass:[CNLivePrivacyTableViewCell class]];
144 145 _arrowImage.image = xw_image;
145 146 }
146 147 return _arrowImage;
... ... @@ -154,21 +155,4 @@ static const NSInteger margin = 12;
154 155 return _notifiSwitch;
155 156 }
156 157  
157   -/**
158   - * 创建图片
159   - *
160   - * @param imageName 图片名字
161   - * @param bundleName 图片所在的bundle名字
162   - * @param targetClass 类和bundle的同级目录
163   - * @return 返回UIImage
164   - */
165   -- (UIImage *)xw_getImageName:(NSString *)imageName bundleName:(NSString *)bundleName targetClass:(Class)targetClass{
166   - NSBundle *bundle = [NSBundle bundleForClass:targetClass];
167   - NSURL *url = [bundle URLForResource:bundleName withExtension:@"bundle"];
168   - NSBundle *targetBundle = [NSBundle bundleWithURL:url];
169   - UIImage *image = [UIImage imageNamed:imageName inBundle:targetBundle compatibleWithTraitCollection:nil];
170   - return image?image:[UIImage imageNamed:imageName inBundle:[NSBundle mainBundle] compatibleWithTraitCollection:nil];
171   -
172   -}
173   -
174 158 @end
... ...
CNLiveSettingModule/Classes/UpdateTel/CNLiveUpdateTelController.m
... ... @@ -15,6 +15,7 @@
15 15 #import <CNLiveUserSystemSDK/CNLiveUserSystemCenter.h>
16 16 #import "CNUserInfoManager.h"
17 17 #import "NSString+CNLiveExtension.h"
  18 +#import "CNLiveCategory.h"
18 19  
19 20 #import "CNLiveSettingNavigationBar.h"
20 21 #import "CNLiveUpdateTelView.h"
... ... @@ -201,22 +202,6 @@ static const NSInteger timeValue = 1.5;
201 202 }
202 203 */
203 204  
204   -/**
205   - * 创建图片
206   - *
207   - * @param imageName 图片名字
208   - * @param bundleName 图片所在的bundle名字
209   - * @param targetClass 类和bundle的同级目录
210   - * @return 返回UIImage
211   - */
212   -- (UIImage *)xw_getImageName:(NSString *)imageName bundleName:(NSString *)bundleName targetClass:(Class)targetClass{
213   - NSBundle *bundle = [NSBundle bundleForClass:targetClass];
214   - NSURL *url = [bundle URLForResource:bundleName withExtension:@"bundle"];
215   - NSBundle *targetBundle = [NSBundle bundleWithURL:url];
216   - UIImage *image = [UIImage imageNamed:imageName inBundle:targetBundle compatibleWithTraitCollection:nil];
217   - return image?image:[UIImage imageNamed:imageName inBundle:[NSBundle mainBundle] compatibleWithTraitCollection:nil];
218   -}
219   -
220 205 #pragma mark - CNLiveSettingNavigationBarDelegate
221 206 - (void)navigationBar:(CNLiveSettingNavigationBar *)navigationBar actionEvents:(NSString *)actionEvents{
222 207 if ([actionEvents isEqualToString:@"1"]) {
... ...
CNLiveSettingModule/Classes/UpdateTel/CNLiveUpdateTelView.m
... ... @@ -14,6 +14,7 @@
14 14 #import <CNLiveUserSystemSDK/CNLiveUserSystemCenter.h>
15 15 #import "NSString+CNLiveExtension.h"
16 16 #import "CNUserInfoManager.h"
  17 +#import "CNLiveCategory.h"
17 18  
18 19 #define TIMECOUNT 60;
19 20  
... ... @@ -203,7 +204,7 @@ static const NSInteger timeValue = 1.5;
203 204 if (!_countryImg) {
204 205 _countryImg = [[UIImageView alloc] init];
205 206 _countryImg.userInteractionEnabled = YES;
206   - UIImage *image = [self xw_getImageName:@"mine_info_front" bundleName:@"CNLiveSettingModule" targetClass:[self class]];
  207 + UIImage *image = [UIImage cn_getImageName:@"mine_info_front" bundleName:@"CNLiveSettingModule" targetClass:[self class]];
207 208 _countryImg.image = image;
208 209 _countryImg.contentMode = UIViewContentModeCenter;
209 210 UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(countryTap:)];
... ... @@ -314,22 +315,6 @@ static const NSInteger timeValue = 1.5;
314 315 }
315 316  
316 317 #pragma mark - 私有方法
317   -/**
318   - * 创建图片
319   - *
320   - * @param imageName 图片名字
321   - * @param bundleName 图片所在的bundle名字
322   - * @param targetClass 类和bundle的同级目录
323   - * @return 返回UIImage
324   - */
325   -- (UIImage *)xw_getImageName:(NSString *)imageName bundleName:(NSString *)bundleName targetClass:(Class)targetClass{
326   - NSBundle *bundle = [NSBundle bundleForClass:targetClass];
327   - NSURL *url = [bundle URLForResource:bundleName withExtension:@"bundle"];
328   - NSBundle *targetBundle = [NSBundle bundleWithURL:url];
329   - UIImage *image = [UIImage imageNamed:imageName inBundle:targetBundle compatibleWithTraitCollection:nil];
330   - return image?image:[UIImage imageNamed:imageName inBundle:[NSBundle mainBundle] compatibleWithTraitCollection:nil];
331   -
332   -}
333 318  
334 319 #pragma mark - Action
335 320 - (void)countryTap:(UITapGestureRecognizer *)tap{
... ...
CNLiveSettingModule/Classes/View/CNLiveSettingCell.m
... ... @@ -8,6 +8,8 @@
8 8  
9 9 #import "CNLiveSettingCell.h"
10 10 #import <Masonry/Masonry.h>
  11 +#import "CNLiveCategory.h"
  12 +
11 13 #import "CNLiveSettingModel.h"
12 14  
13 15 @interface CNLiveSettingCell()
... ... @@ -161,7 +163,7 @@ static const NSInteger margin = 12;
161 163 - (UIImageView *)front {
162 164 if (!_front) {
163 165 _front = [[UIImageView alloc] init];
164   - UIImage *xw_image = [self xw_getImageName:@"mine_info_front" bundleName:@"CNLiveSettingModule" targetClass:[CNLiveSettingCell class]];
  166 + UIImage *xw_image = [UIImage cn_getImageName:@"mine_info_front" bundleName:@"CNLiveSettingModule" targetClass:[CNLiveSettingCell class]];
165 167 _front.image = xw_image;
166 168 _front.contentMode = UIViewContentModeCenter;
167 169  
... ...
CNLiveSettingModule/Classes/View/CNLiveSettingNavigationBar.m
... ... @@ -8,6 +8,7 @@
8 8  
9 9 #import "CNLiveSettingNavigationBar.h"
10 10 #import "QMUIKit.h"
  11 +#import "CNLiveCategory.h"
11 12  
12 13 @interface CNLiveSettingNavigationBar ()
13 14  
... ... @@ -59,7 +60,7 @@ static const NSInteger margin = 15;
59 60 _left= [UIButton buttonWithType:UIButtonTypeCustom];
60 61 _left.adjustsImageWhenHighlighted = NO;
61 62 _left.frame = CGRectMake(margin, StatusBarHeight, NavigationBarHeight, NavigationBarHeight);
62   - UIImage *image = [self xw_getImageName:@"mine_back_black_b" bundleName:@"CNLiveSettingModule" targetClass:[CNLiveSettingNavigationBar class]];
  63 + UIImage *image = [UIImage cn_getImageName:@"mine_back_black_b" bundleName:@"CNLiveSettingModule" targetClass:[CNLiveSettingNavigationBar class]];
63 64 [_left setImage:[image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
64 65 _left.titleLabel.font = [UIFont systemFontOfSize:15];
65 66 [_left setContentHorizontalAlignment:UIControlContentHorizontalAlignmentLeft];
... ...
Example/CNLiveSettingModule.xcodeproj/project.pbxproj
... ... @@ -352,6 +352,7 @@
352 352 "${BUILT_PRODUCTS_DIR}/CNLiveBaseTools/CNLiveBaseTools.framework",
353 353 "${BUILT_PRODUCTS_DIR}/CNLiveBeeHive/CNLiveBeeHive.framework",
354 354 "${BUILT_PRODUCTS_DIR}/CNLiveBusinessTools/CNLiveBusinessTools.framework",
  355 + "${BUILT_PRODUCTS_DIR}/CNLiveCategory/CNLiveCategory.framework",
355 356 "${BUILT_PRODUCTS_DIR}/CNLiveChooseCountry/CNLiveChooseCountry.framework",
356 357 "${BUILT_PRODUCTS_DIR}/CNLiveCommonCategory/CNLiveCommonCategory.framework",
357 358 "${BUILT_PRODUCTS_DIR}/CNLiveCommonClass/CNLiveCommonClass.framework",
... ... @@ -380,6 +381,7 @@
380 381 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBaseTools.framework",
381 382 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBeeHive.framework",
382 383 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBusinessTools.framework",
  384 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCategory.framework",
383 385 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveChooseCountry.framework",
384 386 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCommonCategory.framework",
385 387 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCommonClass.framework",
... ...