Commit 9471cbcd authored by Wei Han's avatar Wei Han

code update

parent d4d839ba
...@@ -529,8 +529,9 @@ ...@@ -529,8 +529,9 @@
[a addAction:[UIAlertAction actionWithTitle:@"No" style:UIAlertActionStyleCancel handler:nil]]; [a addAction:[UIAlertAction actionWithTitle:@"No" style:UIAlertActionStyleCancel handler:nil]];
[a addAction:[UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) { [a addAction:[UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
// pop to dashboard or dismiss - replicate RN behavior // pop to dashboard or dismiss - replicate RN behavior
if (self.navigationController) { UIViewController *presenter = self.presentingViewController;
[self.navigationController popToRootViewControllerAnimated:YES]; if (presenter.presentingViewController) {
[presenter.presentingViewController dismissViewControllerAnimated:YES completion:nil];
} else { } else {
[self dismissViewControllerAnimated:YES completion:nil]; [self dismissViewControllerAnimated:YES completion:nil];
} }
......
...@@ -363,7 +363,12 @@ ...@@ -363,7 +363,12 @@
[a addAction:[UIAlertAction actionWithTitle:@"No" style:UIAlertActionStyleCancel handler:nil]]; [a addAction:[UIAlertAction actionWithTitle:@"No" style:UIAlertActionStyleCancel handler:nil]];
[a addAction:[UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) { [a addAction:[UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
// pop to dashboard or dismiss - replicate RN behavior // pop to dashboard or dismiss - replicate RN behavior
[self.navigationController popToRootViewControllerAnimated:YES]; UIViewController *presenter = self.presentingViewController;
if (presenter.presentingViewController) {
[presenter.presentingViewController dismissViewControllerAnimated:YES completion:nil];
} else {
[self dismissViewControllerAnimated:YES completion:nil];
}
}]]; }]];
[self presentViewController:a animated:YES completion:nil]; [self presentViewController:a animated:YES completion:nil];
} }
......
...@@ -517,11 +517,10 @@ ...@@ -517,11 +517,10 @@
} }
- (void)handleBackTapped { - (void)handleBackTapped {
if (self.navigationController) { UIViewController *presenter = self.presentingViewController;
// If inside a navigation controller → go back if (presenter.presentingViewController) {
[self.navigationController popViewControllerAnimated:YES]; [presenter.presentingViewController dismissViewControllerAnimated:YES completion:nil];
} else { } else {
// Otherwise → dismiss modally
[self dismissViewControllerAnimated:YES completion:nil]; [self dismissViewControllerAnimated:YES completion:nil];
} }
} }
......
...@@ -7,7 +7,7 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -7,7 +7,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface AppointmentViewMoreViewController : UIViewController @interface AppointmentViewMoreViewController : UIViewController
@property (nonatomic, strong) UITableView *agendaTable; @property (nonatomic, strong) UITableView *agendaTable;
@property (nonatomic, strong) NSArray *agendaList; // appointments for selected day @property (nonatomic, strong) NSMutableArray *agendaList;
@end @end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment