From f06da5e379f4118de5cc7c03d6d2b638cff5c4cd Mon Sep 17 00:00:00 2001 From: "Suresh, Kamlesh" Date: Fri, 8 May 2020 17:27:10 -0400 Subject: [PATCH] move backgroud color set to handleNewData --- MVMCoreUI/Atomic/Protocols/TemplateProtocol.swift | 3 --- MVMCoreUI/BaseControllers/ViewController.swift | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Atomic/Protocols/TemplateProtocol.swift b/MVMCoreUI/Atomic/Protocols/TemplateProtocol.swift index fc9873bd..56b1a86c 100644 --- a/MVMCoreUI/Atomic/Protocols/TemplateProtocol.swift +++ b/MVMCoreUI/Atomic/Protocols/TemplateProtocol.swift @@ -22,8 +22,5 @@ public extension TemplateProtocol where Self: ViewController { let templateModel = try decoder.decode(TemplateModel.self, from: data) self.templateModel = templateModel self.pageModel = templateModel as? MVMControllerModelProtocol - if let backgroundColor = templateModel.backgroundColor { - view.backgroundColor = backgroundColor.uiColor - } } } diff --git a/MVMCoreUI/BaseControllers/ViewController.swift b/MVMCoreUI/BaseControllers/ViewController.swift index e9310547..315a0476 100644 --- a/MVMCoreUI/BaseControllers/ViewController.swift +++ b/MVMCoreUI/BaseControllers/ViewController.swift @@ -171,6 +171,10 @@ import UIKit let rules = pageModel?.formRules formValidator = FormValidator(rules) } + + if let backgroundColor = pageModel?.backgroundColor { + view.backgroundColor = backgroundColor.uiColor + } } // MARK: - Navigation Item (Move to model base)