Skip to content

Commit fbfaf8c

Browse files
committed
rewrite comment
1 parent 352da5a commit fbfaf8c

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

Sources/InAppSettingsKit/Controllers/IASKAppSettingsViewController.m

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -903,25 +903,18 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
903903
NSString *segueIdentifier = specifier.segueIdentifier;
904904
if (segueIdentifier) {
905905
@try {
906-
[self performSegueWithIdentifier:segueIdentifier
907-
sender:self];
906+
[self performSegueWithIdentifier:segueIdentifier sender:self];
908907

909-
/*
910-
NOTE: The segue's viewcontroller will be presented modally. Hence any delegate methods on this class, like `viewWillDisappear:` and `viewWillAppear:`, will not be called when that viewcontroller is presented and dismissed. Consequently the selected row is not deselected, since that will be handled in `viewWillAppear:`.
911-
To resolve this, a repeating timer is used to check whether the presented view controller gets dismissed.
912-
*/
908+
// The segue's view controller will be presented modally. Hence any delegate methods on this class, like `viewWillDisappear:` and `viewWillAppear:`, will not be called when that view controller is presented and dismissed. In order to deselect the row upon dismissal, we use a repeating timer that checks whether the presented view controller gets dismissed.
913909
NSTimer *checkSegueDismissedTimer = [NSTimer timerWithTimeInterval:0.1
914910
repeats:YES
915911
block:^(NSTimer * _Nonnull timer) {
916912
// When the presented view controller is dismissed:
917913
if (self.presentedViewController == nil) {
918-
// Deselect row:
919-
[self.tableView deselectRowAtIndexPath:indexPath
920-
animated:YES];
914+
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];
921915

922-
// Stop timer:
923916
if ([timer isValid]) {
924-
[timer invalidate];
917+
[timer invalidate]; // Stop timer
925918
}
926919
}
927920
}];

0 commit comments

Comments
 (0)