diff --git a/PanModal/Controller/PanModalPresentationController.swift b/PanModal/Controller/PanModalPresentationController.swift index a5c3c54..21a1ab1 100644 --- a/PanModal/Controller/PanModalPresentationController.swift +++ b/PanModal/Controller/PanModalPresentationController.swift @@ -186,6 +186,7 @@ public class PanModalPresentationController: UIPresentationController { coordinator.animate(alongsideTransition: { [weak self] _ in self?.backgroundView.dimState = .max + self?.presentedViewController.setNeedsStatusBarAppearanceUpdate() }) } @@ -203,6 +204,7 @@ public class PanModalPresentationController: UIPresentationController { coordinator.animate(alongsideTransition: { [weak self] _ in self?.dragIndicatorView.alpha = 0.0 self?.backgroundView.dimState = .off + self?.presentingViewController.setNeedsStatusBarAppearanceUpdate() }) } diff --git a/PanModal/Presenter/UIViewController+PanModalPresenter.swift b/PanModal/Presenter/UIViewController+PanModalPresenter.swift index 8bbf382..a7716d1 100644 --- a/PanModal/Presenter/UIViewController+PanModalPresenter.swift +++ b/PanModal/Presenter/UIViewController+PanModalPresenter.swift @@ -50,6 +50,7 @@ extension UIViewController: PanModalPresenter { viewControllerToPresent.popoverPresentationController?.delegate = PanModalPresentationDelegate.default } else { viewControllerToPresent.modalPresentationStyle = .custom + viewControllerToPresent.modalPresentationCapturesStatusBarAppearance = true viewControllerToPresent.transitioningDelegate = PanModalPresentationDelegate.default } diff --git a/Sample/View Controllers/BasicViewController.swift b/Sample/View Controllers/BasicViewController.swift index c1440b5..2056651 100644 --- a/Sample/View Controllers/BasicViewController.swift +++ b/Sample/View Controllers/BasicViewController.swift @@ -18,6 +18,10 @@ class BasicViewController: UIViewController { extension BasicViewController: PanModalPresentable { + override var preferredStatusBarStyle: UIStatusBarStyle { + return .lightContent + } + var panScrollable: UIScrollView? { return nil } diff --git a/Sample/View Controllers/User Groups (Navigation Controller)/NavigationController.swift b/Sample/View Controllers/User Groups (Navigation Controller)/NavigationController.swift index 5a5eddc..239b9e2 100644 --- a/Sample/View Controllers/User Groups (Navigation Controller)/NavigationController.swift +++ b/Sample/View Controllers/User Groups (Navigation Controller)/NavigationController.swift @@ -12,6 +12,10 @@ class NavigationController: UINavigationController, PanModalPresentable { private let navGroups = NavUserGroups() + override var preferredStatusBarStyle: UIStatusBarStyle { + return .lightContent + } + override func viewDidLoad() { super.viewDidLoad() pushViewController(navGroups, animated: false) diff --git a/Sample/View Controllers/User Groups (Stacked)/StackedProfileViewController.swift b/Sample/View Controllers/User Groups (Stacked)/StackedProfileViewController.swift index 564aa01..4dfed8d 100644 --- a/Sample/View Controllers/User Groups (Stacked)/StackedProfileViewController.swift +++ b/Sample/View Controllers/User Groups (Stacked)/StackedProfileViewController.swift @@ -14,6 +14,10 @@ class StackedProfileViewController: UIViewController, PanModalPresentable { let presentable: UserGroupMemberPresentable + override var preferredStatusBarStyle: UIStatusBarStyle { + return .lightContent + } + // MARK: - Views let avatarView: UIView = { diff --git a/Sample/View Controllers/User Groups/UserGroupViewController.swift b/Sample/View Controllers/User Groups/UserGroupViewController.swift index 4642401..83b60ce 100644 --- a/Sample/View Controllers/User Groups/UserGroupViewController.swift +++ b/Sample/View Controllers/User Groups/UserGroupViewController.swift @@ -34,6 +34,10 @@ class UserGroupViewController: UITableViewController, PanModalPresentable, UIGes var isShortFormEnabled = true + override var preferredStatusBarStyle: UIStatusBarStyle { + return .lightContent + } + let headerView = UserGroupHeaderView() let headerPresentable = UserGroupHeaderPresentable.init(handle: "ios-engs", description: "iOS Engineers", memberCount: 10)