From e98d3a090c32ffe23c20461a7f334db099ba2590 Mon Sep 17 00:00:00 2001 From: "Thuy.Copeland" Date: Thu, 26 Jul 2018 12:28:25 -0500 Subject: [PATCH 01/11] Add viewcontroller background style definition --- .../Authenticator/WordPressAuthenticatorStyles.swift | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/WordPressAuthenticator/Authenticator/WordPressAuthenticatorStyles.swift b/WordPressAuthenticator/Authenticator/WordPressAuthenticatorStyles.swift index 164ea6f55..c78faa607 100644 --- a/WordPressAuthenticator/Authenticator/WordPressAuthenticatorStyles.swift +++ b/WordPressAuthenticator/Authenticator/WordPressAuthenticatorStyles.swift @@ -41,9 +41,13 @@ public struct WordPressAuthenticatorStyle { /// public let subheadlineColor: UIColor + /// Style: Login screen background colors + /// + public let viewControllerBackgroundColor: UIColor + /// Designated initializer /// - public init(primaryNormalBackgroundColor: UIColor, primaryNormalBorderColor: UIColor, primaryHighlightBackgroundColor: UIColor, primaryHighlightBorderColor: UIColor, secondaryNormalBackgroundColor: UIColor, secondaryNormalBorderColor: UIColor, secondaryHighlightBackgroundColor: UIColor, secondaryHighlightBorderColor: UIColor, disabledBackgroundColor: UIColor, disabledBorderColor: UIColor, primaryTitleColor: UIColor, secondaryTitleColor: UIColor, disabledTitleColor: UIColor, subheadlineColor: UIColor) { + public init(primaryNormalBackgroundColor: UIColor, primaryNormalBorderColor: UIColor, primaryHighlightBackgroundColor: UIColor, primaryHighlightBorderColor: UIColor, secondaryNormalBackgroundColor: UIColor, secondaryNormalBorderColor: UIColor, secondaryHighlightBackgroundColor: UIColor, secondaryHighlightBorderColor: UIColor, disabledBackgroundColor: UIColor, disabledBorderColor: UIColor, primaryTitleColor: UIColor, secondaryTitleColor: UIColor, disabledTitleColor: UIColor, subheadlineColor: UIColor, viewControllerBackgroundColor: UIColor) { self.primaryNormalBackgroundColor = primaryNormalBackgroundColor self.primaryNormalBorderColor = primaryNormalBorderColor self.primaryHighlightBackgroundColor = primaryHighlightBackgroundColor @@ -58,6 +62,7 @@ public struct WordPressAuthenticatorStyle { self.secondaryTitleColor = secondaryTitleColor self.disabledTitleColor = disabledTitleColor self.subheadlineColor = subheadlineColor + self.viewControllerBackgroundColor = viewControllerBackgroundColor } } @@ -76,6 +81,8 @@ public extension WordPressAuthenticatorStyle { primaryTitleColor: UIColor.white, secondaryTitleColor: WPStyleGuide.darkGrey(), disabledTitleColor: WPStyleGuide.greyLighten30(), - subheadlineColor: WPStyleGuide.wordPressBlue()) + subheadlineColor: WPStyleGuide.wordPressBlue(), + viewControllerBackgroundColor: UIColor.purple //WPStyleGuide.lightGrey() + ) } } From 4ae960978b153d334c9bdf7aaddc70350997f167 Mon Sep 17 00:00:00 2001 From: "Thuy.Copeland" Date: Thu, 26 Jul 2018 12:53:47 -0500 Subject: [PATCH 02/11] Login prologue view controller background color styling --- WordPressAuthenticator/Signin/Login.storyboard | 11 +++++------ .../Signin/LoginPrologueViewController.swift | 9 +++++++++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/WordPressAuthenticator/Signin/Login.storyboard b/WordPressAuthenticator/Signin/Login.storyboard index cb0152b34..5202f8008 100644 --- a/WordPressAuthenticator/Signin/Login.storyboard +++ b/WordPressAuthenticator/Signin/Login.storyboard @@ -107,7 +107,6 @@ - @@ -1182,10 +1181,10 @@ - - - - - + + + + + diff --git a/WordPressAuthenticator/Signin/LoginPrologueViewController.swift b/WordPressAuthenticator/Signin/LoginPrologueViewController.swift index 5dd9132b9..e4394d671 100644 --- a/WordPressAuthenticator/Signin/LoginPrologueViewController.swift +++ b/WordPressAuthenticator/Signin/LoginPrologueViewController.swift @@ -14,6 +14,11 @@ class LoginPrologueViewController: LoginViewController { // MARK: - Lifecycle Methods + override func viewDidLoad() { + super.viewDidLoad() + styleBackground() + } + override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) configureButtonVC() @@ -55,6 +60,10 @@ class LoginPrologueViewController: LoginViewController { } } + private func styleBackground() { + view.backgroundColor = WordPressAuthenticator.shared.style.viewControllerBackgroundColor + } + private func configureButtonVC() { guard let buttonViewController = buttonViewController else { return From 99a2eeefed594abd97eb99e6b00b4b7ed9ab1e3b Mon Sep 17 00:00:00 2001 From: "Thuy.Copeland" Date: Thu, 26 Jul 2018 12:59:02 -0500 Subject: [PATCH 03/11] Login email view controller background color styling --- WordPressAuthenticator/Signin/Login.storyboard | 1 - .../Signin/LoginEmailViewController.swift | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/WordPressAuthenticator/Signin/Login.storyboard b/WordPressAuthenticator/Signin/Login.storyboard index 5202f8008..ff8a9150c 100644 --- a/WordPressAuthenticator/Signin/Login.storyboard +++ b/WordPressAuthenticator/Signin/Login.storyboard @@ -319,7 +319,6 @@ - diff --git a/WordPressAuthenticator/Signin/LoginEmailViewController.swift b/WordPressAuthenticator/Signin/LoginEmailViewController.swift index 408baafe4..c4d7f6bf4 100644 --- a/WordPressAuthenticator/Signin/LoginEmailViewController.swift +++ b/WordPressAuthenticator/Signin/LoginEmailViewController.swift @@ -42,6 +42,7 @@ open class LoginEmailViewController: LoginViewController, NUXKeyboardResponder { override open func viewDidLoad() { super.viewDidLoad() + styleBackground() localizeControls() setupOnePasswordButtonIfNeeded() addGoogleButton() @@ -97,6 +98,13 @@ open class LoginEmailViewController: LoginViewController, NUXKeyboardResponder { } + /// Styles the view's background color. Defaults to WPStyleGuide.lightGrey() + /// + private func styleBackground() { + view.backgroundColor = WordPressAuthenticator.shared.style.viewControllerBackgroundColor + } + + /// Assigns localized strings to various UIControl defined in the storyboard. /// func localizeControls() { From 488dd01c5d5561352d7135bea6fd6e6b69f5e04f Mon Sep 17 00:00:00 2001 From: "Thuy.Copeland" Date: Thu, 26 Jul 2018 13:17:30 -0500 Subject: [PATCH 04/11] Login self-hosted view controller background styling --- WordPressAuthenticator/Signin/Login.storyboard | 1 - .../Signin/LoginSelfHostedViewController.swift | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/WordPressAuthenticator/Signin/Login.storyboard b/WordPressAuthenticator/Signin/Login.storyboard index ff8a9150c..480210865 100644 --- a/WordPressAuthenticator/Signin/Login.storyboard +++ b/WordPressAuthenticator/Signin/Login.storyboard @@ -545,7 +545,6 @@ - diff --git a/WordPressAuthenticator/Signin/LoginSelfHostedViewController.swift b/WordPressAuthenticator/Signin/LoginSelfHostedViewController.swift index 9f1888367..6b28bbe0e 100644 --- a/WordPressAuthenticator/Signin/LoginSelfHostedViewController.swift +++ b/WordPressAuthenticator/Signin/LoginSelfHostedViewController.swift @@ -32,6 +32,7 @@ class LoginSelfHostedViewController: LoginViewController, NUXKeyboardResponder { override func viewDidLoad() { super.viewDidLoad() + styleBackground() configureHeader() localizeControls() setupOnePasswordButtonIfNeeded() @@ -72,6 +73,11 @@ class LoginSelfHostedViewController: LoginViewController, NUXKeyboardResponder { // MARK: - Setup and Configuration + /// Styles the view's background color. Defaults to WPStyleGuide.lightGrey() + /// + private func styleBackground() { + view.backgroundColor = WordPressAuthenticator.shared.style.viewControllerBackgroundColor + } /// Assigns localized strings to various UIControl defined in the storyboard. /// From 58f973dd7a5a68207215bd1e4661bf7024f73b78 Mon Sep 17 00:00:00 2001 From: "Thuy.Copeland" Date: Thu, 26 Jul 2018 13:19:11 -0500 Subject: [PATCH 05/11] Login WP.com view controller background styling --- WordPressAuthenticator/Signin/Login.storyboard | 1 - .../Signin/LoginWPComViewController.swift | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/WordPressAuthenticator/Signin/Login.storyboard b/WordPressAuthenticator/Signin/Login.storyboard index 480210865..61dbfa100 100644 --- a/WordPressAuthenticator/Signin/Login.storyboard +++ b/WordPressAuthenticator/Signin/Login.storyboard @@ -718,7 +718,6 @@ - diff --git a/WordPressAuthenticator/Signin/LoginWPComViewController.swift b/WordPressAuthenticator/Signin/LoginWPComViewController.swift index 5572490f1..4ee9fdf7f 100644 --- a/WordPressAuthenticator/Signin/LoginWPComViewController.swift +++ b/WordPressAuthenticator/Signin/LoginWPComViewController.swift @@ -32,6 +32,7 @@ class LoginWPComViewController: LoginViewController, NUXKeyboardResponder { override func viewDidLoad() { super.viewDidLoad() + styleBackground() localizeControls() setupOnePasswordButtonIfNeeded() } @@ -118,6 +119,12 @@ class LoginWPComViewController: LoginViewController, NUXKeyboardResponder { emailLabel?.text = loginFields.username } + /// Styles the view's background color. Defaults to WPStyleGuide.lightGrey() + /// + @objc func styleBackground() { + view.backgroundColor = WordPressAuthenticator.shared.style.viewControllerBackgroundColor + } + @objc func localizeControls() { if let service = loginFields.meta.socialService, service == SocialServiceName.google { instructionLabel?.text = NSLocalizedString("To proceed with this Google account, please first log in with your WordPress.com password. This will only be asked once.", comment: "") From d73d73d707f4786cf2b748e8a48b1c6bab45d509 Mon Sep 17 00:00:00 2001 From: "Thuy.Copeland" Date: Thu, 26 Jul 2018 14:43:31 -0500 Subject: [PATCH 06/11] Login2FA VC background styling --- WordPressAuthenticator/Signin/Login.storyboard | 1 - WordPressAuthenticator/Signin/Login2FAViewController.swift | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/WordPressAuthenticator/Signin/Login.storyboard b/WordPressAuthenticator/Signin/Login.storyboard index 61dbfa100..58e7e33dd 100644 --- a/WordPressAuthenticator/Signin/Login.storyboard +++ b/WordPressAuthenticator/Signin/Login.storyboard @@ -881,7 +881,6 @@ - diff --git a/WordPressAuthenticator/Signin/Login2FAViewController.swift b/WordPressAuthenticator/Signin/Login2FAViewController.swift index 8f0ffe4c2..9fd5d3ddb 100644 --- a/WordPressAuthenticator/Signin/Login2FAViewController.swift +++ b/WordPressAuthenticator/Signin/Login2FAViewController.swift @@ -30,6 +30,7 @@ class Login2FAViewController: LoginViewController, NUXKeyboardResponder, UITextF override func viewDidLoad() { super.viewDidLoad() + styleBackground() localizeControls() configureTextFields() configureSubmitButton(animating: false) @@ -82,6 +83,11 @@ class Login2FAViewController: LoginViewController, NUXKeyboardResponder, UITextF // MARK: Configuration Methods + /// Styles the view's background color. Defaults to WPStyleGuide.lightGrey() + /// + @objc func styleBackground() { + view.backgroundColor = WordPressAuthenticator.shared.style.viewControllerBackgroundColor + } /// Assigns localized strings to various UIControl defined in the storyboard. /// From 07fd291b0ad628b1eb3415044843a91e13d77f29 Mon Sep 17 00:00:00 2001 From: "Thuy.Copeland" Date: Fri, 27 Jul 2018 13:39:13 -0500 Subject: [PATCH 07/11] LoginLInkRequest VC background styiling --- WordPressAuthenticator/Signin/Login.storyboard | 1 - .../Signin/LoginLinkRequestViewController.swift | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/WordPressAuthenticator/Signin/Login.storyboard b/WordPressAuthenticator/Signin/Login.storyboard index 58e7e33dd..1847dae51 100644 --- a/WordPressAuthenticator/Signin/Login.storyboard +++ b/WordPressAuthenticator/Signin/Login.storyboard @@ -978,7 +978,6 @@ - diff --git a/WordPressAuthenticator/Signin/LoginLinkRequestViewController.swift b/WordPressAuthenticator/Signin/LoginLinkRequestViewController.swift index 950966159..67be8f24f 100644 --- a/WordPressAuthenticator/Signin/LoginLinkRequestViewController.swift +++ b/WordPressAuthenticator/Signin/LoginLinkRequestViewController.swift @@ -24,6 +24,7 @@ class LoginLinkRequestViewController: LoginViewController { override func viewDidLoad() { super.viewDidLoad() + styleBackground() localizeControls() let email = loginFields.username @@ -50,6 +51,12 @@ class LoginLinkRequestViewController: LoginViewController { // MARK: - Configuration + /// Styles the view's background color. Defaults to WPStyleGuide.lightGrey() + /// + @objc func styleBackground() { + view.backgroundColor = WordPressAuthenticator.shared.style.viewControllerBackgroundColor + } + /// Assigns localized strings to various UIControl defined in the storyboard. /// @objc func localizeControls() { From 8dabadb367de5225ccecbe679957a0a60e4bf4fc Mon Sep 17 00:00:00 2001 From: "Thuy.Copeland" Date: Fri, 27 Jul 2018 13:42:17 -0500 Subject: [PATCH 08/11] LoginStieAddress VC background styling --- WordPressAuthenticator/Signin/Login.storyboard | 1 - .../Signin/LoginSiteAddressViewController.swift | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/WordPressAuthenticator/Signin/Login.storyboard b/WordPressAuthenticator/Signin/Login.storyboard index 1847dae51..06b96f995 100644 --- a/WordPressAuthenticator/Signin/Login.storyboard +++ b/WordPressAuthenticator/Signin/Login.storyboard @@ -1127,7 +1127,6 @@ - diff --git a/WordPressAuthenticator/Signin/LoginSiteAddressViewController.swift b/WordPressAuthenticator/Signin/LoginSiteAddressViewController.swift index 19f93ed92..a350cacea 100644 --- a/WordPressAuthenticator/Signin/LoginSiteAddressViewController.swift +++ b/WordPressAuthenticator/Signin/LoginSiteAddressViewController.swift @@ -29,6 +29,8 @@ class LoginSiteAddressViewController: LoginViewController, NUXKeyboardResponder override func viewDidLoad() { super.viewDidLoad() + + styleBackground() localizeControls() } @@ -64,6 +66,12 @@ class LoginSiteAddressViewController: LoginViewController, NUXKeyboardResponder // MARK: Setup and Configuration + /// Styles the view's background color. Defaults to WPStyleGuide.lightGrey() + /// + @objc func styleBackground() { + view.backgroundColor = WordPressAuthenticator.shared.style.viewControllerBackgroundColor + } + /// Assigns localized strings to various UIControl defined in the storyboard. /// @objc func localizeControls() { From 07d999ab6c731288eeef369f66d8d73ed1f187e6 Mon Sep 17 00:00:00 2001 From: "Thuy.Copeland" Date: Fri, 27 Jul 2018 14:13:18 -0500 Subject: [PATCH 09/11] Expose nav bar logo for styling --- .../WordPressAuthenticatorStyles.swift | 13 ++++++++++--- .../NUX/NUXViewControllerBase.swift | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/WordPressAuthenticator/Authenticator/WordPressAuthenticatorStyles.swift b/WordPressAuthenticator/Authenticator/WordPressAuthenticatorStyles.swift index c78faa607..ea4a33bc2 100644 --- a/WordPressAuthenticator/Authenticator/WordPressAuthenticatorStyles.swift +++ b/WordPressAuthenticator/Authenticator/WordPressAuthenticatorStyles.swift @@ -1,4 +1,5 @@ - +import UIKit +import Gridicons // MARK: - WordPress Authenticator Styles // @@ -45,9 +46,13 @@ public struct WordPressAuthenticatorStyle { /// public let viewControllerBackgroundColor: UIColor + /// Style: nav bar logo + /// + public let navBarImage: UIImage + /// Designated initializer /// - public init(primaryNormalBackgroundColor: UIColor, primaryNormalBorderColor: UIColor, primaryHighlightBackgroundColor: UIColor, primaryHighlightBorderColor: UIColor, secondaryNormalBackgroundColor: UIColor, secondaryNormalBorderColor: UIColor, secondaryHighlightBackgroundColor: UIColor, secondaryHighlightBorderColor: UIColor, disabledBackgroundColor: UIColor, disabledBorderColor: UIColor, primaryTitleColor: UIColor, secondaryTitleColor: UIColor, disabledTitleColor: UIColor, subheadlineColor: UIColor, viewControllerBackgroundColor: UIColor) { + public init(primaryNormalBackgroundColor: UIColor, primaryNormalBorderColor: UIColor, primaryHighlightBackgroundColor: UIColor, primaryHighlightBorderColor: UIColor, secondaryNormalBackgroundColor: UIColor, secondaryNormalBorderColor: UIColor, secondaryHighlightBackgroundColor: UIColor, secondaryHighlightBorderColor: UIColor, disabledBackgroundColor: UIColor, disabledBorderColor: UIColor, primaryTitleColor: UIColor, secondaryTitleColor: UIColor, disabledTitleColor: UIColor, subheadlineColor: UIColor, viewControllerBackgroundColor: UIColor, navBarImage: UIImage) { self.primaryNormalBackgroundColor = primaryNormalBackgroundColor self.primaryNormalBorderColor = primaryNormalBorderColor self.primaryHighlightBackgroundColor = primaryHighlightBackgroundColor @@ -63,6 +68,7 @@ public struct WordPressAuthenticatorStyle { self.disabledTitleColor = disabledTitleColor self.subheadlineColor = subheadlineColor self.viewControllerBackgroundColor = viewControllerBackgroundColor + self.navBarImage = navBarImage } } @@ -82,7 +88,8 @@ public extension WordPressAuthenticatorStyle { secondaryTitleColor: WPStyleGuide.darkGrey(), disabledTitleColor: WPStyleGuide.greyLighten30(), subheadlineColor: WPStyleGuide.wordPressBlue(), - viewControllerBackgroundColor: UIColor.purple //WPStyleGuide.lightGrey() + viewControllerBackgroundColor: WPStyleGuide.lightGrey(), + navBarImage: Gridicon.iconOfType(.mySites) ) } } diff --git a/WordPressAuthenticator/NUX/NUXViewControllerBase.swift b/WordPressAuthenticator/NUX/NUXViewControllerBase.swift index 6c08d8311..256a3a7c0 100644 --- a/WordPressAuthenticator/NUX/NUXViewControllerBase.swift +++ b/WordPressAuthenticator/NUX/NUXViewControllerBase.swift @@ -144,7 +144,7 @@ extension NUXViewControllerBase where Self: UIViewController, Self: UIViewContro /// Adds the WP logo to the nav controller /// public func addWordPressLogoToNavController() { - let image = Gridicon.iconOfType(.mySites) + let image = WordPressAuthenticator.shared.style.navBarImage let imageView = UIImageView(image: image.imageWithTintColor(UIColor.white)) navigationItem.titleView = imageView } From 360c475ba198aec162d6f6e49d1b29fc810423a5 Mon Sep 17 00:00:00 2001 From: "Thuy.Copeland" Date: Mon, 6 Aug 2018 10:02:34 -0500 Subject: [PATCH 10/11] Remove styleBackground() from individual VCs and add to base class, `LoginVC` --- .../Signin/Login2FAViewController.swift | 7 ------- .../Signin/LoginEmailViewController.swift | 8 -------- .../Signin/LoginLinkRequestViewController.swift | 7 ------- .../Signin/LoginPrologueViewController.swift | 9 --------- .../Signin/LoginSelfHostedViewController.swift | 7 ------- .../Signin/LoginSiteAddressViewController.swift | 7 ------- WordPressAuthenticator/Signin/LoginViewController.swift | 7 +++++++ .../Signin/LoginWPComViewController.swift | 7 ------- 8 files changed, 7 insertions(+), 52 deletions(-) diff --git a/WordPressAuthenticator/Signin/Login2FAViewController.swift b/WordPressAuthenticator/Signin/Login2FAViewController.swift index 9fd5d3ddb..e31715406 100644 --- a/WordPressAuthenticator/Signin/Login2FAViewController.swift +++ b/WordPressAuthenticator/Signin/Login2FAViewController.swift @@ -30,7 +30,6 @@ class Login2FAViewController: LoginViewController, NUXKeyboardResponder, UITextF override func viewDidLoad() { super.viewDidLoad() - styleBackground() localizeControls() configureTextFields() configureSubmitButton(animating: false) @@ -83,12 +82,6 @@ class Login2FAViewController: LoginViewController, NUXKeyboardResponder, UITextF // MARK: Configuration Methods - /// Styles the view's background color. Defaults to WPStyleGuide.lightGrey() - /// - @objc func styleBackground() { - view.backgroundColor = WordPressAuthenticator.shared.style.viewControllerBackgroundColor - } - /// Assigns localized strings to various UIControl defined in the storyboard. /// @objc func localizeControls() { diff --git a/WordPressAuthenticator/Signin/LoginEmailViewController.swift b/WordPressAuthenticator/Signin/LoginEmailViewController.swift index c4d7f6bf4..408baafe4 100644 --- a/WordPressAuthenticator/Signin/LoginEmailViewController.swift +++ b/WordPressAuthenticator/Signin/LoginEmailViewController.swift @@ -42,7 +42,6 @@ open class LoginEmailViewController: LoginViewController, NUXKeyboardResponder { override open func viewDidLoad() { super.viewDidLoad() - styleBackground() localizeControls() setupOnePasswordButtonIfNeeded() addGoogleButton() @@ -98,13 +97,6 @@ open class LoginEmailViewController: LoginViewController, NUXKeyboardResponder { } - /// Styles the view's background color. Defaults to WPStyleGuide.lightGrey() - /// - private func styleBackground() { - view.backgroundColor = WordPressAuthenticator.shared.style.viewControllerBackgroundColor - } - - /// Assigns localized strings to various UIControl defined in the storyboard. /// func localizeControls() { diff --git a/WordPressAuthenticator/Signin/LoginLinkRequestViewController.swift b/WordPressAuthenticator/Signin/LoginLinkRequestViewController.swift index 67be8f24f..950966159 100644 --- a/WordPressAuthenticator/Signin/LoginLinkRequestViewController.swift +++ b/WordPressAuthenticator/Signin/LoginLinkRequestViewController.swift @@ -24,7 +24,6 @@ class LoginLinkRequestViewController: LoginViewController { override func viewDidLoad() { super.viewDidLoad() - styleBackground() localizeControls() let email = loginFields.username @@ -51,12 +50,6 @@ class LoginLinkRequestViewController: LoginViewController { // MARK: - Configuration - /// Styles the view's background color. Defaults to WPStyleGuide.lightGrey() - /// - @objc func styleBackground() { - view.backgroundColor = WordPressAuthenticator.shared.style.viewControllerBackgroundColor - } - /// Assigns localized strings to various UIControl defined in the storyboard. /// @objc func localizeControls() { diff --git a/WordPressAuthenticator/Signin/LoginPrologueViewController.swift b/WordPressAuthenticator/Signin/LoginPrologueViewController.swift index e4394d671..5dd9132b9 100644 --- a/WordPressAuthenticator/Signin/LoginPrologueViewController.swift +++ b/WordPressAuthenticator/Signin/LoginPrologueViewController.swift @@ -14,11 +14,6 @@ class LoginPrologueViewController: LoginViewController { // MARK: - Lifecycle Methods - override func viewDidLoad() { - super.viewDidLoad() - styleBackground() - } - override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) configureButtonVC() @@ -60,10 +55,6 @@ class LoginPrologueViewController: LoginViewController { } } - private func styleBackground() { - view.backgroundColor = WordPressAuthenticator.shared.style.viewControllerBackgroundColor - } - private func configureButtonVC() { guard let buttonViewController = buttonViewController else { return diff --git a/WordPressAuthenticator/Signin/LoginSelfHostedViewController.swift b/WordPressAuthenticator/Signin/LoginSelfHostedViewController.swift index 6b28bbe0e..333a8187e 100644 --- a/WordPressAuthenticator/Signin/LoginSelfHostedViewController.swift +++ b/WordPressAuthenticator/Signin/LoginSelfHostedViewController.swift @@ -32,7 +32,6 @@ class LoginSelfHostedViewController: LoginViewController, NUXKeyboardResponder { override func viewDidLoad() { super.viewDidLoad() - styleBackground() configureHeader() localizeControls() setupOnePasswordButtonIfNeeded() @@ -73,12 +72,6 @@ class LoginSelfHostedViewController: LoginViewController, NUXKeyboardResponder { // MARK: - Setup and Configuration - /// Styles the view's background color. Defaults to WPStyleGuide.lightGrey() - /// - private func styleBackground() { - view.backgroundColor = WordPressAuthenticator.shared.style.viewControllerBackgroundColor - } - /// Assigns localized strings to various UIControl defined in the storyboard. /// @objc func localizeControls() { diff --git a/WordPressAuthenticator/Signin/LoginSiteAddressViewController.swift b/WordPressAuthenticator/Signin/LoginSiteAddressViewController.swift index a350cacea..544d61dd3 100644 --- a/WordPressAuthenticator/Signin/LoginSiteAddressViewController.swift +++ b/WordPressAuthenticator/Signin/LoginSiteAddressViewController.swift @@ -30,7 +30,6 @@ class LoginSiteAddressViewController: LoginViewController, NUXKeyboardResponder override func viewDidLoad() { super.viewDidLoad() - styleBackground() localizeControls() } @@ -65,12 +64,6 @@ class LoginSiteAddressViewController: LoginViewController, NUXKeyboardResponder // MARK: Setup and Configuration - - /// Styles the view's background color. Defaults to WPStyleGuide.lightGrey() - /// - @objc func styleBackground() { - view.backgroundColor = WordPressAuthenticator.shared.style.viewControllerBackgroundColor - } /// Assigns localized strings to various UIControl defined in the storyboard. /// diff --git a/WordPressAuthenticator/Signin/LoginViewController.swift b/WordPressAuthenticator/Signin/LoginViewController.swift index 80b501c33..8d963e980 100644 --- a/WordPressAuthenticator/Signin/LoginViewController.swift +++ b/WordPressAuthenticator/Signin/LoginViewController.swift @@ -38,6 +38,7 @@ open class LoginViewController: NUXViewController, LoginFacadeDelegate { super.viewDidLoad() displayError(message: "") setupNavBarIcon() + styleBackground() styleInstructions() if let error = errorToPresent { @@ -57,6 +58,12 @@ open class LoginViewController: NUXViewController, LoginFacadeDelegate { addWordPressLogoToNavController() } + /// Styles the view's background color. Defaults to WPStyleGuide.lightGrey() + /// + @objc func styleBackground() { + view.backgroundColor = WordPressAuthenticator.shared.style.viewControllerBackgroundColor + } + /// Configures instruction label font /// func styleInstructions() { diff --git a/WordPressAuthenticator/Signin/LoginWPComViewController.swift b/WordPressAuthenticator/Signin/LoginWPComViewController.swift index 4ee9fdf7f..5572490f1 100644 --- a/WordPressAuthenticator/Signin/LoginWPComViewController.swift +++ b/WordPressAuthenticator/Signin/LoginWPComViewController.swift @@ -32,7 +32,6 @@ class LoginWPComViewController: LoginViewController, NUXKeyboardResponder { override func viewDidLoad() { super.viewDidLoad() - styleBackground() localizeControls() setupOnePasswordButtonIfNeeded() } @@ -119,12 +118,6 @@ class LoginWPComViewController: LoginViewController, NUXKeyboardResponder { emailLabel?.text = loginFields.username } - /// Styles the view's background color. Defaults to WPStyleGuide.lightGrey() - /// - @objc func styleBackground() { - view.backgroundColor = WordPressAuthenticator.shared.style.viewControllerBackgroundColor - } - @objc func localizeControls() { if let service = loginFields.meta.socialService, service == SocialServiceName.google { instructionLabel?.text = NSLocalizedString("To proceed with this Google account, please first log in with your WordPress.com password. This will only be asked once.", comment: "") From 81e910b734f031d67219b567de7257a2c1c18b0c Mon Sep 17 00:00:00 2001 From: "Thuy.Copeland" Date: Mon, 6 Aug 2018 10:04:48 -0500 Subject: [PATCH 11/11] Restore original spacing --- WordPressAuthenticator/Signin/Login2FAViewController.swift | 1 + .../Signin/LoginSelfHostedViewController.swift | 1 + .../Signin/LoginSiteAddressViewController.swift | 3 +-- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/WordPressAuthenticator/Signin/Login2FAViewController.swift b/WordPressAuthenticator/Signin/Login2FAViewController.swift index e31715406..8f0ffe4c2 100644 --- a/WordPressAuthenticator/Signin/Login2FAViewController.swift +++ b/WordPressAuthenticator/Signin/Login2FAViewController.swift @@ -82,6 +82,7 @@ class Login2FAViewController: LoginViewController, NUXKeyboardResponder, UITextF // MARK: Configuration Methods + /// Assigns localized strings to various UIControl defined in the storyboard. /// @objc func localizeControls() { diff --git a/WordPressAuthenticator/Signin/LoginSelfHostedViewController.swift b/WordPressAuthenticator/Signin/LoginSelfHostedViewController.swift index 333a8187e..9f1888367 100644 --- a/WordPressAuthenticator/Signin/LoginSelfHostedViewController.swift +++ b/WordPressAuthenticator/Signin/LoginSelfHostedViewController.swift @@ -72,6 +72,7 @@ class LoginSelfHostedViewController: LoginViewController, NUXKeyboardResponder { // MARK: - Setup and Configuration + /// Assigns localized strings to various UIControl defined in the storyboard. /// @objc func localizeControls() { diff --git a/WordPressAuthenticator/Signin/LoginSiteAddressViewController.swift b/WordPressAuthenticator/Signin/LoginSiteAddressViewController.swift index 544d61dd3..19f93ed92 100644 --- a/WordPressAuthenticator/Signin/LoginSiteAddressViewController.swift +++ b/WordPressAuthenticator/Signin/LoginSiteAddressViewController.swift @@ -29,7 +29,6 @@ class LoginSiteAddressViewController: LoginViewController, NUXKeyboardResponder override func viewDidLoad() { super.viewDidLoad() - localizeControls() } @@ -64,7 +63,7 @@ class LoginSiteAddressViewController: LoginViewController, NUXKeyboardResponder // MARK: Setup and Configuration - + /// Assigns localized strings to various UIControl defined in the storyboard. /// @objc func localizeControls() {