File tree Expand file tree Collapse file tree
Coding_iOS/Controllers/ProjectSetting Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414#import < UIView+SDCAutoLayout.h>
1515#import " ProjectDeleteAlertControllerVisualStyle.h"
1616
17- @interface ProjectAdvancedSettingViewController ()
17+ @interface ProjectAdvancedSettingViewController ()<UITextFieldDelegate>
1818
1919@end
2020
@@ -80,15 +80,14 @@ -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *
8080 passwordTextField.layer .borderWidth = 1 ;
8181 passwordTextField.secureTextEntry = YES ;
8282 passwordTextField.backgroundColor = [UIColor whiteColor ];
83+ passwordTextField.delegate = self;
8384
8485 [alert.contentView addSubview: passwordTextField];
8586
8687 NSDictionary * passwordViews = NSDictionaryOfVariableBindings(passwordTextField);
8788
8889 [alert.contentView addConstraints: [NSLayoutConstraint constraintsWithVisualFormat: @" V:|-[passwordTextField]-(>=14)-|" options: 0 metrics: nil views: passwordViews]];
8990
90- [passwordTextField becomeFirstResponder ];
91-
9291 // Style
9392 alert.visualStyle = [ProjectDeleteAlertControllerVisualStyle new ];
9493
@@ -115,7 +114,15 @@ -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *
115114 }
116115 }]];
117116
118- [alert presentWithCompletion: nil ];
117+ [alert presentWithCompletion: ^{
118+ [passwordTextField becomeFirstResponder ];
119+ }];
120+ }
121+
122+
123+ -(BOOL )textFieldShouldReturn : (UITextField *)textField {
124+ [textField resignFirstResponder ];
125+ return YES ;
119126}
120127
121128@end
You can’t perform that action at this time.
0 commit comments