From cf88010a46778f7fb98a29ebb6d63632cfc75f2b Mon Sep 17 00:00:00 2001 From: Daniel Dahan Date: Tue, 9 Jan 2018 08:54:11 -0600 Subject: [PATCH] issue-1016: potential enhancement for traversing stacked controllers --- Sources/iOS/Material+UIViewController.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/iOS/Material+UIViewController.swift b/Sources/iOS/Material+UIViewController.swift index dabc43583..c82dadf9a 100644 --- a/Sources/iOS/Material+UIViewController.swift +++ b/Sources/iOS/Material+UIViewController.swift @@ -42,7 +42,8 @@ internal extension UIViewController { if v is T { return v as? T } - v = v?.parent as? TransitionController + + v = v?.parent } return Application.rootViewController?.traverseTransitionViewControllerHierarchyForClassType() @@ -55,6 +56,7 @@ internal extension UIViewController { func traverseTransitionViewControllerHierarchyForClassType() -> T? { if let v = self as? T { return v + } else if let v = self as? TransitionController { return v.rootViewController.traverseTransitionViewControllerHierarchyForClassType() }