Commit 5830b099 by Orkhan Alikhanov

Fixed some view controllers not themed in the hierarchy

parent a217eaa1
......@@ -139,14 +139,14 @@ public extension Theme {
return
}
viewController.children.forEach {
viewController.allChildren.forEach {
apply(theme: theme, to: $0)
$0.view.isProcessed = true
}
apply(theme: theme, to: viewController.view)
viewController.children.forEach {
viewController.allChildren.forEach {
$0.view.isProcessed = false
}
......@@ -194,6 +194,23 @@ public extension Themeable where Self: NSObject {
}
}
private extension UIViewController {
/// Returns all possible child view controllers.
var allChildren: [UIViewController] {
var all = children
if let v = self as? TabsController {
all += v.viewControllers
}
if let v = presentedViewController, v.presentingViewController === self {
all.append(v)
}
return all
}
}
/// A memory reference to the isProcessed for UIView.
private var IsProcessedKey: UInt8 = 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment