Skip to content

Commit 5af513b

Browse files
committed
Added callback logic
1 parent 86c5656 commit 5af513b

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

TOPasscodeViewController/TOPasscodeSettingsViewController.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,12 @@ - (void)confirmNewPasscode:(NSString *)passcode
404404
self.errorLabel.hidden = NO;
405405
return;
406406
}
407+
408+
if (![self.delegate respondsToSelector:@selector(passcodeSettingsViewController:didChangeToNewPasscode:ofType:)]) {
409+
return;
410+
}
411+
412+
[self.delegate passcodeSettingsViewController:self didChangeToNewPasscode:self.potentialPasscode ofType:self.passcodeType];
407413
}
408414

409415
#pragma mark - Button Callbacks -

TOPasscodeViewControllerExample/SettingsViewController.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ - (BOOL)passcodeSettingsViewController:(TOPasscodeSettingsViewController *)passc
6060

6161
- (void)passcodeSettingsViewController:(TOPasscodeSettingsViewController *)passcodeSettingsViewController didChangeToNewPasscode:(NSString *)passcode ofType:(TOPasscodeType)type
6262
{
63-
63+
self.passcode = passcode;
64+
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationNone];
65+
[self.navigationController popViewControllerAnimated:YES];
6466
}
6567

6668
#pragma mark - Table view data source

0 commit comments

Comments
 (0)