diff --git a/Mastodon/Coordinator/SceneCoordinator.swift b/Mastodon/Coordinator/SceneCoordinator.swift index 11d098345..4206077ab 100644 --- a/Mastodon/Coordinator/SceneCoordinator.swift +++ b/Mastodon/Coordinator/SceneCoordinator.swift @@ -151,7 +151,7 @@ extension SceneCoordinator { case safariPresent(animated: Bool, completion: (() -> Void)? = nil) case alertController(animated: Bool, completion: (() -> Void)? = nil) case activityViewControllerPresent(animated: Bool, completion: (() -> Void)? = nil) - case formSheet + case formSheet([UISheetPresentationController.Detent]?) case none } @@ -357,10 +357,10 @@ extension SceneCoordinator { viewController.modalPresentationCapturesStatusBarAppearance = true presentingViewController.present(viewController, animated: animated, completion: completion) - case .formSheet: + case .formSheet(let detents): viewController.modalPresentationStyle = .formSheet if let sheetPresentation = viewController.sheetPresentationController { - sheetPresentation.detents = [.large(), .medium()] + sheetPresentation.detents = detents ?? [.medium(), .large()] } presentingViewController.present(viewController, animated: true) } diff --git a/Mastodon/In Progress New Layout and Datamodel/NotificationListViewController.swift b/Mastodon/In Progress New Layout and Datamodel/NotificationListViewController.swift index bc3fe0942..9af503781 100644 --- a/Mastodon/In Progress New Layout and Datamodel/NotificationListViewController.swift +++ b/Mastodon/In Progress New Layout and Datamodel/NotificationListViewController.swift @@ -85,7 +85,7 @@ class NotificationListViewController: UIHostingController adminSettings: adminSettings ) - guard let policyViewController = self.sceneCoordinator?.present(scene: .notificationPolicy(viewModel: policyViewModel), transition: .formSheet) as? NotificationPolicyViewController else { return } + guard let policyViewController = self.sceneCoordinator?.present(scene: .notificationPolicy(viewModel: policyViewModel), transition: .formSheet(policyViewModel.adminFilterSettings != nil ? [.large()] : nil)) as? NotificationPolicyViewController else { return } policyViewController.delegate = self } diff --git a/Mastodon/Scene/Root/MainTab/MainTabBarController.swift b/Mastodon/Scene/Root/MainTab/MainTabBarController.swift index 9a54c4fbf..3b349ca60 100644 --- a/Mastodon/Scene/Root/MainTab/MainTabBarController.swift +++ b/Mastodon/Scene/Root/MainTab/MainTabBarController.swift @@ -320,7 +320,7 @@ extension MainTabBarController { case .me: guard let authenticationBox else { return } let accountListViewModel = AccountListViewModel(authenticationBox: authenticationBox) - _ = self.sceneCoordinator?.present(scene: .accountList(viewModel: accountListViewModel), from: self, transition: .formSheet) + _ = self.sceneCoordinator?.present(scene: .accountList(viewModel: accountListViewModel), from: self, transition: .formSheet(nil)) default: break }