[ios] Click to display the input box password

- (void)viewDidLoad {
    [super viewDidLoad];
    
    _showPwd.tag = 100; //The initial state tag of the button
    
}

- (IBAction)showPwdClicked:(UIButton *)sender {
    switch (_showPwd.tag) {
            //To show password
        case 100:
            _password.secureTextEntry = NO;
            _showPwd.tag = 200; //Change the state tag after clicking
            break;
            
        case 200:
            _password.secureTextEntry = YES;
            _showPwd.tag = 100;
            break;
    }
}

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326316528&siteId=291194637