Created
April 9, 2017 16:23
-
-
Save frosty/8c68ce16e768dabc45977fa0b52cfc4d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationsViewController.swift b/WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationsViewController.swift | |
index afea6d00d..ee190bf8e 100644 | |
--- a/WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationsViewController.swift | |
+++ b/WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationsViewController.swift | |
@@ -514,7 +514,26 @@ extension NotificationsViewController { | |
return | |
} | |
- performSegue(withIdentifier: NotificationDetailsViewController.classNameWithoutNamespaces(), sender: note) | |
+ if let controller = storyboard?.instantiateViewController(withIdentifier: "NotificationDetailsViewController") as? NotificationDetailsViewController { | |
+ configureDetailsViewController(controller, withNote: note) | |
+ | |
+ workaroundShowDetailViewController(controller) | |
+ } | |
+ } | |
+ | |
+ private func workaroundShowDetailViewController(_ viewController: UIViewController) { | |
+ if UIApplication.shared.applicationState != .active { | |
+ var navigationController = self.navigationController | |
+ | |
+ if let controllerCount = splitViewController?.viewControllers.count, | |
+ controllerCount > 1 { | |
+ navigationController = splitViewController?.viewControllers.last as? UINavigationController | |
+ } | |
+ | |
+ navigationController?.pushViewController(viewController, animated: true) | |
+ } else { | |
+ showDetailViewController(viewController, sender: self) | |
+ } | |
} | |
fileprivate func prepareToShowDetailsForNotification(_ note: Notification) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment