@@ -66,12 +66,10 @@ class LoginPrologueViewController: LoginViewController {
6666 topContainerView. pinSubviewToAllEdges ( topContainerChildViewController. view)
6767 }
6868
69+ setupViewBackground ( )
6970 createButtonViewController ( )
7071
7172 defaultButtonViewMargin = buttonViewLeadingConstraint? . constant ?? 0
72- if let backgroundImage = WordPressAuthenticator . shared. unifiedStyle? . prologueBackgroundImage {
73- view. layer. contents = backgroundImage. cgImage
74- }
7573 }
7674
7775 override func styleBackground( ) {
@@ -386,22 +384,23 @@ class LoginPrologueViewController: LoginViewController {
386384 }
387385 }
388386
387+ private func setupViewBackground( ) {
388+ if let prologueViewBackgroundColor = WordPressAuthenticator . shared. unifiedStyle? . prologueViewBackgroundColor {
389+ view. backgroundColor = prologueViewBackgroundColor
390+ }
391+
392+ if let backgroundImage = WordPressAuthenticator . shared. unifiedStyle? . prologueBackgroundImage {
393+ view. layer. contents = backgroundImage. cgImage
394+ }
395+ }
396+
389397 private func setButtonViewControllerBackground( ) {
390398 // Fallback to setting the button background color to clear so the blur effect blurs the Prologue background color.
391399 let buttonsBackgroundColor = WordPressAuthenticator . shared. unifiedStyle? . prologueButtonsBackgroundColor ?? . clear
392400 buttonViewController? . backgroundColor = buttonsBackgroundColor
393401 buttonBackgroundView? . backgroundColor = buttonsBackgroundColor
394402 stackedButtonsViewController? . backgroundColor = buttonsBackgroundColor
395403
396- /// If host apps provide a background color for the prologue buttons:
397- /// 1. Hide the blur effect
398- /// 2. Set the background color of the view controller to prologueViewBackgroundColor
399- let prologueViewBackgroundColor = WordPressAuthenticator . shared. unifiedStyle? . prologueViewBackgroundColor ?? . clear
400-
401- // do not set background color if we've set a background image earlier
402- if WordPressAuthenticator . shared. unifiedStyle? . prologueBackgroundImage == nil {
403- view. backgroundColor = prologueViewBackgroundColor
404- }
405404 // if a blur effect for the buttons was passed, use it; otherwise hide the view.
406405 guard let blurEffect = WordPressAuthenticator . shared. unifiedStyle? . prologueButtonsBlurEffect else {
407406 buttonBlurEffectView. isHidden = true
0 commit comments