11 #import "EditSecretTextTableViewCell.h"
15 @synthesize label = _label, textfield = _textfield;
20 [_unhide_button setTitle:NSLocalizedString(@"Unhide", @"Button title 'Unhide'")
21 forState:UIControlStateNormal];
22 [_unhide_button addTarget:self
23 action:@selector(togglePasswordMode:)
24 forControlEvents:UIControlEventTouchUpInside];
27 - (void)setEnabled:(BOOL)enabled
29 [_label setEnabled:enabled];
30 [_textfield setEnabled:enabled];
31 [_unhide_button setEnabled:enabled];
34 #pragma mark - action handlers
35 - (void)togglePasswordMode:(
id)sender
37 BOOL isSecure = [_textfield isSecureTextEntry];
41 [_unhide_button setTitle:NSLocalizedString(@"Hide", @"Button title 'Hide'")
42 forState:UIControlStateNormal];
43 [_textfield setSecureTextEntry:NO];
47 BOOL first_responder = [_textfield isFirstResponder];
51 [_textfield setEnabled:NO];
52 [_unhide_button setTitle:NSLocalizedString(@"Unhide", @"Button title 'Unhide'")
53 forState:UIControlStateNormal];
54 [_textfield setSecureTextEntry:YES];
55 [_textfield setEnabled:YES];
57 [_textfield becomeFirstResponder];