Commit 1e72be780fda0894dbce28d160b0c5fa69be1734
1 parent
adfa1293
0.6.4
Showing
2 changed files
with
22 additions
and
4 deletions
CNLiveCMineModule.podspec
| @@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
| 8 | 8 | ||
| 9 | Pod::Spec.new do |s| | 9 | Pod::Spec.new do |s| |
| 10 | s.name = 'CNLiveCMineModule' | 10 | s.name = 'CNLiveCMineModule' |
| 11 | - s.version = '0.6.3' | 11 | + s.version = '0.6.4' |
| 12 | s.summary = '网家家C端个人中心' | 12 | s.summary = '网家家C端个人中心' |
| 13 | 13 | ||
| 14 | # This description is used to generate tags and improve search results. | 14 | # This description is used to generate tags and improve search results. |
CNLiveCMineModule/Classes/CNCMine/View/CNMineEvaAlertView.m
| @@ -93,9 +93,9 @@ | @@ -93,9 +93,9 @@ | ||
| 93 | } | 93 | } |
| 94 | + (CNMineEvaAlertView *)setUpFeelBadEvaluateAlertViewDoneBlock:(void (^)(NSString * _Nonnull))doneBlock cancelBlock:(nonnull void (^)(void))cancelBlock{ | 94 | + (CNMineEvaAlertView *)setUpFeelBadEvaluateAlertViewDoneBlock:(void (^)(NSString * _Nonnull))doneBlock cancelBlock:(nonnull void (^)(void))cancelBlock{ |
| 95 | CNMineEvaAlertView *alertView = [CNMineEvaAlertView alertView]; | 95 | CNMineEvaAlertView *alertView = [CNMineEvaAlertView alertView]; |
| 96 | + __weak typeof(alertView) weakAlert = alertView; | ||
| 96 | UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithActionBlock:^(id _Nonnull sender) { | 97 | UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithActionBlock:^(id _Nonnull sender) { |
| 97 | - alertView.frame = CGRectMake(0, 0,DS_adapt_length(339), DS_adapt_length(567)); | ||
| 98 | - [alertView.textView endEditing:YES]; | 98 | + [weakAlert.textView endEditing:YES]; |
| 99 | }]; | 99 | }]; |
| 100 | [alertView addGestureRecognizer:tap]; | 100 | [alertView addGestureRecognizer:tap]; |
| 101 | alertView.frame = CGRectMake(0, 0,kScreenWidth *339/367, kScreenWidth *567/367); | 101 | alertView.frame = CGRectMake(0, 0,kScreenWidth *339/367, kScreenWidth *567/367); |
| @@ -112,6 +112,7 @@ | @@ -112,6 +112,7 @@ | ||
| 112 | __block NSString *swichChooseStr = nil; | 112 | __block NSString *swichChooseStr = nil; |
| 113 | alertView.switchView.chooseBlock = ^(NSString * _Nonnull result) { | 113 | alertView.switchView.chooseBlock = ^(NSString * _Nonnull result) { |
| 114 | swichChooseStr = result; | 114 | swichChooseStr = result; |
| 115 | + [weakAlert.textView endEditing:YES]; | ||
| 115 | }; | 116 | }; |
| 116 | [alertView.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) { | 117 | [alertView.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) { |
| 117 | make.right.top.equalTo(alertView); | 118 | make.right.top.equalTo(alertView); |
| @@ -169,7 +170,6 @@ | @@ -169,7 +170,6 @@ | ||
| 169 | modalViewController.contentView = alertView; | 170 | modalViewController.contentView = alertView; |
| 170 | modalViewController.modal = YES; | 171 | modalViewController.modal = YES; |
| 171 | [modalViewController showWithAnimated:YES completion:nil]; | 172 | [modalViewController showWithAnimated:YES completion:nil]; |
| 172 | - __weak typeof(alertView) weakAlert = alertView; | ||
| 173 | [alertView.closeBtn addBlockForControlEvents:UIControlEventTouchUpInside block:^(id _Nonnull sender) { | 173 | [alertView.closeBtn addBlockForControlEvents:UIControlEventTouchUpInside block:^(id _Nonnull sender) { |
| 174 | [weakModal hideWithAnimated:YES completion:^(BOOL finished) { | 174 | [weakModal hideWithAnimated:YES completion:^(BOOL finished) { |
| 175 | if (cancelBlock) cancelBlock(); | 175 | if (cancelBlock) cancelBlock(); |
| @@ -186,6 +186,24 @@ | @@ -186,6 +186,24 @@ | ||
| 186 | }]; | 186 | }]; |
| 187 | return alertView; | 187 | return alertView; |
| 188 | } | 188 | } |
| 189 | +- (void)dealloc{ | ||
| 190 | + [[NSNotificationCenter defaultCenter] removeObserver:self]; | ||
| 191 | + NSLog(@"CNMineEvaAlertView - dealloc"); | ||
| 192 | +} | ||
| 193 | +- (instancetype)init{ | ||
| 194 | + if(self = [super init]){ | ||
| 195 | + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardShowNoti:) name:UIKeyboardWillShowNotification object:Nil]; | ||
| 196 | + } | ||
| 197 | + return self; | ||
| 198 | +} | ||
| 199 | +#pragma mark - notification | ||
| 200 | +- (void)keyboardShowNoti:(NSNotification *)noti{ | ||
| 201 | + NSDictionary *userInfo = noti.userInfo; | ||
| 202 | + CGRect keyboardRect = [[userInfo objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; | ||
| 203 | + CGFloat heyboardHeight = keyboardRect.size.height; | ||
| 204 | + self.top -= heyboardHeight; | ||
| 205 | +} | ||
| 206 | +#pragma mark - Getting | ||
| 189 | - (UIView *)bgView | 207 | - (UIView *)bgView |
| 190 | { | 208 | { |
| 191 | if (!_bgView) { | 209 | if (!_bgView) { |