输入密码与确认密码的匹配提示

UITextField对象的方法状态是forControlEvents:UIControlEventEditingChanged

- (IBAction)textFieldDidChange:(UITextField *)sender {
    if (![_paidPwdField.text hasPrefix:_paidPwdAgainField.text]) {
        _hud = [MBProgressHUD showHUDAddedTo:[[UIApplication sharedApplication].windows lastObject] animated:YES];
        _hud.userInteractionEnabled = NO;
        _hud.mode = MBProgressHUDModeCustomView;
        _hud.detailsLabelText = @"再次输入密码与上次输入密码不一致";
        [_hud hide:YES afterDelay:1];
        
    }
}


你可能感兴趣的:(输入密码与确认密码的匹配提示)