Skip to content

Commit

Permalink
Merge pull request #443 from aizatomar/dismiss-view-controller
Browse files Browse the repository at this point in the history
Dismiss or pop view controllers accordingly
  • Loading branch information
TimOliver authored Nov 15, 2020
2 parents 9d3e42a + 438f216 commit 69fa475
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Objective-C/TOCropViewController/TOCropViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -887,11 +887,10 @@ - (void)dismissCropViewController

// If neither callbacks were implemented, perform a default dismissing animation
if (!isDelegateOrCallbackHandled) {
if (self.navigationController) {
if (self.navigationController && self.navigationController.viewControllers.count > 1) {
[self.navigationController popViewControllerAnimated:YES];
}
else {
self.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
}
}
Expand Down Expand Up @@ -939,8 +938,13 @@ - (void)doneButtonTapped
}

if (!isCallbackOrDelegateHandled) {
[self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
blockController.completionWithItemsHandler = nil;
if (self.navigationController != nil && self.navigationController.viewControllers.count > 1) {
[self.navigationController popViewControllerAnimated:YES];
}
else {
[self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
blockController.completionWithItemsHandler = nil;
}
}
};

Expand Down

0 comments on commit 69fa475

Please sign in to comment.