Commit e9fc6bb6 by Orkhan Alikhanov

Added applying theme for only components created in a code block

parent ca4a485d
......@@ -129,4 +129,17 @@ public extension Theme {
apply(theme: theme, to: $0)
}
}
/**
Applies provided theme for the components created within the given block
without chaging app's theme.
- Parameter theme: A Theme.
- Parameter for block: A code block.
*/
static func applying(theme: Theme, for execute: () -> Void) {
let v = current
current = theme
execute()
current = v
}
}
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