Skip to content

Commit

Permalink
issue-1016: potential enhancement for traversing stacked controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Dahan committed Jan 9, 2018
1 parent fb2a453 commit cf88010
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Sources/iOS/Material+UIViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -55,6 +56,7 @@ internal extension UIViewController {
func traverseTransitionViewControllerHierarchyForClassType<T: UIViewController>() -> T? {
if let v = self as? T {
return v

} else if let v = self as? TransitionController {
return v.rootViewController.traverseTransitionViewControllerHierarchyForClassType()
}
Expand Down

0 comments on commit cf88010

Please sign in to comment.