From d2db60f761d33db2689c2ce3da082584d753b207 Mon Sep 17 00:00:00 2001 From: Eric Leung Date: Wed, 5 Feb 2020 13:53:41 +0800 Subject: [PATCH 1/2] added addProperties function --- Stylist/Stylist.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Stylist/Stylist.swift b/Stylist/Stylist.swift index 5eda109..036afe4 100644 --- a/Stylist/Stylist.swift +++ b/Stylist/Stylist.swift @@ -45,6 +45,10 @@ public class Stylist { public func addProperty(_ property: StyleProperty) { properties.append(property) } + + public func addProperties(_ styleProperties: [StyleProperty]) { + properties += styleProperties + } public func addObject(_ object: StyleObject) { objects.append(object) From 2b4a619b478c46d186df6cfbd86a1e950ae96d36 Mon Sep 17 00:00:00 2001 From: Eric Leung Date: Tue, 18 Feb 2020 16:16:34 +0800 Subject: [PATCH 2/2] add resetThemesAndStyles --- Stylist/Stylist.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Stylist/Stylist.swift b/Stylist/Stylist.swift index 036afe4..ef35a60 100644 --- a/Stylist/Stylist.swift +++ b/Stylist/Stylist.swift @@ -60,7 +60,12 @@ public class Stylist { properties = [] addDefaultProperties() } - + + public func resetThemesAndStyles() { + themes = [:] + styles = [] + } + func getValidProperties(name: String, view: Any) -> [StyleProperty] { return properties.filter { $0.canStyle(name: name, view: view) } }