Skip to content

Commit 8c02f34

Browse files
author
Erik Strottmann
authored
Merge pull request #7 from clutter/ios-13
Set default modal style to full-screen
2 parents 4d791ad + 51c1587 commit 8c02f34

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

TiltUp/Classes/Architecture/Coordinator.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,19 @@ public extension Router {
6666

6767
public extension Router {
6868
// MARK: Presenting modals
69-
func presentModal(_ viewController: UIViewController, retaining coordinator: Coordinating, animated: Bool = true, dismissHandler: (() -> Void)? = nil) {
69+
func presentModal(_ viewController: UIViewController, retaining coordinator: Coordinating, animated: Bool = true, presentationStyle: UIModalPresentationStyle = .fullScreen, dismissHandler: (() -> Void)? = nil) {
7070
coordinator.appCoordinator.pushCoordinator(coordinator)
71-
presentModal(viewController, animated: animated) { [weak coordinator] in
71+
presentModal(viewController, animated: animated, presentationStyle: presentationStyle) { [weak coordinator] in
7272
dismissHandler?()
7373
if let coordinator = coordinator {
7474
coordinator.appCoordinator.popCoordinator(coordinator)
7575
}
7676
}
7777
}
7878

79-
func presentModal(_ router: Router, retaining coordinator: Coordinating, animated: Bool = true, dismissHandler: (() -> Void)? = nil) {
79+
func presentModal(_ router: Router, retaining coordinator: Coordinating, animated: Bool = true, presentationStyle: UIModalPresentationStyle = .fullScreen, dismissHandler: (() -> Void)? = nil) {
8080
coordinator.appCoordinator.pushCoordinator(coordinator)
81-
presentModal(router, animated: animated) { [weak coordinator] in
81+
presentModal(router, animated: animated, presentationStyle: presentationStyle) { [weak coordinator] in
8282
dismissHandler?()
8383
if let coordinator = coordinator {
8484
coordinator.appCoordinator.popCoordinator(coordinator)

TiltUp/Classes/Architecture/Router.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,16 @@ public extension Router {
8989

9090
public extension Router {
9191
// MARK: Presenting modals
92-
func presentModal(_ viewController: UIViewController, animated: Bool = true, dismissHandler: (() -> Void)? = nil) {
92+
func presentModal(_ viewController: UIViewController, animated: Bool = true, presentationStyle: UIModalPresentationStyle = .fullScreen, dismissHandler: (() -> Void)? = nil) {
93+
viewController.modalPresentationStyle = presentationStyle
9394
navigationController.present(viewController, animated: animated) {
9495
self.dismissHandler = dismissHandler
9596
}
9697
}
9798

98-
func presentModal(_ router: Router, animated: Bool = true, dismissHandler: (() -> Void)? = nil) {
99+
func presentModal(_ router: Router, animated: Bool = true, presentationStyle: UIModalPresentationStyle = .fullScreen, dismissHandler: (() -> Void)? = nil) {
99100
self.presentedRouter = router
100-
presentModal(router.navigationController, animated: animated, dismissHandler: dismissHandler)
101+
presentModal(router.navigationController, animated: animated, presentationStyle: presentationStyle, dismissHandler: dismissHandler)
101102
}
102103

103104
// MARK: Dismissing modals

0 commit comments

Comments
 (0)