Refactor code to coordinator (IOS-241)
This commit is contained in:
parent
ed4a003a74
commit
c79e26b7e5
|
@ -207,6 +207,7 @@ extension SceneCoordinator {
|
|||
case settings(setting: Setting)
|
||||
|
||||
// Notifications
|
||||
case notificationPolicy(viewModel: NotificationFilterViewModel)
|
||||
case notificationRequests(viewModel: NotificationRequestsViewModel)
|
||||
|
||||
// report
|
||||
|
@ -563,6 +564,8 @@ private extension SceneCoordinator {
|
|||
viewController = composeViewController
|
||||
case .notificationRequests(let viewModel):
|
||||
viewController = NotificationRequestsTableViewController(viewModel: viewModel)
|
||||
case .notificationPolicy(let viewModel):
|
||||
viewController = NotificationPolicyViewController(viewModel: viewModel)
|
||||
}
|
||||
|
||||
setupDependency(for: viewController as? NeedsDependency)
|
||||
|
|
|
@ -127,16 +127,8 @@ extension NotificationViewController {
|
|||
newAccount: policy.filterNewAccounts,
|
||||
privateMentions: policy.filterPrivateMentions
|
||||
)
|
||||
//TODO: Move to SceneCoordinator, we'd need a new case for this
|
||||
let notificationPolicyViewController = NotificationPolicyViewController(viewModel: policyViewModel)
|
||||
notificationPolicyViewController.modalPresentationStyle = .formSheet
|
||||
let navigationController = UINavigationController(rootViewController: notificationPolicyViewController)
|
||||
|
||||
if let sheet = navigationController.sheetPresentationController {
|
||||
sheet.detents = [.medium(), .large()]
|
||||
}
|
||||
|
||||
present(navigationController, animated: true)
|
||||
_ = coordinator.present(scene: .notificationPolicy(viewModel: policyViewModel), transition: .formSheet)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue