From 00a54dede157a638615180fb5f6823bdbcd4e013 Mon Sep 17 00:00:00 2001 From: Andrea Busi Date: Thu, 1 Oct 2020 19:16:04 +0200 Subject: [PATCH] feat: Show country selection on first app start --- .../Seismic Networks/SeismicNetworksViewController.swift | 7 +++++++ Sources/Earthquake Network/Costanti.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Sources/Earthquake Network/Controllers/Seismic Networks/SeismicNetworksViewController.swift b/Sources/Earthquake Network/Controllers/Seismic Networks/SeismicNetworksViewController.swift index 83feb89..12cc905 100644 --- a/Sources/Earthquake Network/Controllers/Seismic Networks/SeismicNetworksViewController.swift +++ b/Sources/Earthquake Network/Controllers/Seismic Networks/SeismicNetworksViewController.swift @@ -45,6 +45,13 @@ class SeismicNetworksViewController: EQNBaseViewController, UITableViewDelegate, setupUI() refreshUI() + + // only the first time, show the popup for country selection + let alreadyPresented = UserDefaults.standard.bool(forKey: EQNUserDefaultKeyOneShotShowCountry) + if !alreadyPresented { + performSegue(withIdentifier: Self.SegueIdentifierSettings, sender: nil) + UserDefaults.standard.setValue(true, forKey: EQNUserDefaultKeyOneShotShowCountry) + } } private func setupUI() { diff --git a/Sources/Earthquake Network/Costanti.h b/Sources/Earthquake Network/Costanti.h index 0eb4a68..58e204c 100644 --- a/Sources/Earthquake Network/Costanti.h +++ b/Sources/Earthquake Network/Costanti.h @@ -40,7 +40,7 @@ static NSString * const EQNServerUrlUploadSettings = @"https://srv.earthquakenet #pragma mark - UserDefaults Keys static NSString * const EQNUserDefaultKeySesmicInformations = @"EQNetwork.SeismicInformations"; - +static NSString * const EQNUserDefaultKeyOneShotShowCountry = @"EQNetwork.OneShot.CountrySelection"; // URL registrazione server #define URL_SERVER_REGISTRAZIONE @"http://srv.earthquakenetwork.it/distquake_upload_gcm_regid2.php"