From 3c249ee8f6327900563fd91518df71e9cf8c6d7c Mon Sep 17 00:00:00 2001 From: Aleksey Belouosv Date: Fri, 22 Feb 2019 15:59:07 +0300 Subject: [PATCH] [iOS] update onboarding and what's new screens layout Also fix "black screen" bug on first start --- iphone/Maps/Classes/MapViewController.mm | 2 +- iphone/Maps/UI/Storyboard/Welcome.storyboard | 821 +++++++++--------- .../Maps/UI/Welcome/WhatsNewController.swift | 32 +- 3 files changed, 413 insertions(+), 442 deletions(-) diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm index 0ba7b4bcfa..9cccc16a3d 100644 --- a/iphone/Maps/Classes/MapViewController.mm +++ b/iphone/Maps/Classes/MapViewController.mm @@ -251,7 +251,6 @@ BOOL gIsFirstMyPositionMode = YES; [self updateStatusBarStyle]; GetFramework().InvalidateRendering(); - [self.welcomePageController show]; [self showViralAlertIfNeeded]; [self checkAuthorization]; } @@ -271,6 +270,7 @@ BOOL gIsFirstMyPositionMode = YES; selector:@selector(didBecomeActive) name:UIApplicationDidBecomeActiveNotification object:nil]; + [self.welcomePageController show]; } - (void)didBecomeActive diff --git a/iphone/Maps/UI/Storyboard/Welcome.storyboard b/iphone/Maps/UI/Storyboard/Welcome.storyboard index 89cf1ca647..c0e266c0ef 100644 --- a/iphone/Maps/UI/Storyboard/Welcome.storyboard +++ b/iphone/Maps/UI/Storyboard/Welcome.storyboard @@ -1,21 +1,19 @@ - + - - - + - + - + @@ -23,161 +21,181 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - + + + + + + + + - - - - - - + + + + + + + + - - - - - - - + + + + + + + + - - - - - - - - + + + + + + @@ -244,280 +262,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -894,7 +639,261 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iphone/Maps/UI/Welcome/WhatsNewController.swift b/iphone/Maps/UI/Welcome/WhatsNewController.swift index 48a26098fe..d8e42ad1f9 100644 --- a/iphone/Maps/UI/Welcome/WhatsNewController.swift +++ b/iphone/Maps/UI/Welcome/WhatsNewController.swift @@ -5,8 +5,6 @@ final class WhatsNewController: WelcomeViewController { let title: String let text: String let buttonTitle: String - let ctaButtonTitle: String? - let ctaButtonUrl: String? } static var welcomeConfigs: [WelcomeConfig] { @@ -14,15 +12,11 @@ final class WhatsNewController: WelcomeViewController { WhatsNewConfig(image: #imageLiteral(resourceName: "whatsnew_85_1"), title: "whats_new_ugc_routes_title", text: "whats_new_ugc_routes_subtitle", - buttonTitle: "whats_new_next_button", - ctaButtonTitle: nil, - ctaButtonUrl: nil), + buttonTitle: "whats_new_next_button"), WhatsNewConfig(image: #imageLiteral(resourceName: "whatsnew_85_2"), title: "whats_new_webeditor_title", text: "whats_new_ugc_routes_message2", - buttonTitle: "done", - ctaButtonTitle: nil, - ctaButtonUrl: nil) + buttonTitle: "done") ] } @@ -47,26 +41,4 @@ final class WhatsNewController: WelcomeViewController { } return result } - - @IBOutlet weak var ctaButton: UIButton! - - override func viewDidLoad() { - super.viewDidLoad() - let config = pageConfig as! WhatsNewConfig - if let ctaTitleKey = config.ctaButtonTitle { - ctaButton.setTitle(L(ctaTitleKey), for: .normal) - } else { - ctaButton.isHidden = true - } - } - - @IBAction func onCta() { - let config = pageConfig as! WhatsNewConfig - if let url = URL(string: config.ctaButtonUrl!) { - UIApplication.shared.open(url) - } else { - assertionFailure() - } - close() - } }