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

code update

parent d4d839ba
......@@ -529,8 +529,9 @@
[a addAction:[UIAlertAction actionWithTitle:@"No" style:UIAlertActionStyleCancel handler:nil]];
[a addAction:[UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
// pop to dashboard or dismiss - replicate RN behavior
if (self.navigationController) {
[self.navigationController popToRootViewControllerAnimated:YES];
UIViewController *presenter = self.presentingViewController;
if (presenter.presentingViewController) {
[presenter.presentingViewController dismissViewControllerAnimated:YES completion:nil];
} else {
[self dismissViewControllerAnimated:YES completion:nil];
}
......
......@@ -363,7 +363,12 @@
[a addAction:[UIAlertAction actionWithTitle:@"No" style:UIAlertActionStyleCancel handler:nil]];
[a addAction:[UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
// 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];
}
......
......@@ -517,11 +517,10 @@
}
- (void)handleBackTapped {
if (self.navigationController) {
// If inside a navigation controller → go back
[self.navigationController popViewControllerAnimated:YES];
UIViewController *presenter = self.presentingViewController;
if (presenter.presentingViewController) {
[presenter.presentingViewController dismissViewControllerAnimated:YES completion:nil];
} else {
// Otherwise → dismiss modally
[self dismissViewControllerAnimated:YES completion:nil];
}
}
......
......@@ -7,7 +7,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface AppointmentViewMoreViewController : UIViewController
@property (nonatomic, strong) UITableView *agendaTable;
@property (nonatomic, strong) NSArray *agendaList; // appointments for selected day
@property (nonatomic, strong) NSMutableArray *agendaList;
@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