From ea2573c17cec340fb8db40e8f1da4f76ca1dd4f6 Mon Sep 17 00:00:00 2001 From: Andrea Busi Date: Mon, 21 Sep 2020 14:43:27 +0200 Subject: [PATCH] refactor: Reorganize some constants --- Sources/Earthquake Network/Costanti.h | 19 +++++++------------ .../ViewController/ReteSmartphone.m | 8 +++----- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/Sources/Earthquake Network/Costanti.h b/Sources/Earthquake Network/Costanti.h index 467471b..ce1bfb1 100644 --- a/Sources/Earthquake Network/Costanti.h +++ b/Sources/Earthquake Network/Costanti.h @@ -9,6 +9,13 @@ #ifndef Costanti_h #define Costanti_h +#pragma mark - Urls + +static NSString * const EQNWebsiteAddress = @"https://www.sismo.app"; +static NSString * const EQNTwitterProfileUrl = @"https://twitter.com/SismoDetector"; + +#pragma mark - Math Constants + // costante gravitazionale #define G 9.81 @@ -44,17 +51,10 @@ #define URL_LINK_MESSAGGIO @"http://www.finazzieng.it/mysql/distquake_download_message.php" -// twitter -#define TWITTER_LINK @"https://twitter.com/SismoDetector" - #define TEMPO_INVIO_MESSAGGIO 5 #define TEMPO_INVIO_COMMENTO 30 -// informazioni menu sinistra -static NSString * const EQNWebsiteAddress = @"https://www.sismo.app"; - - // download reti sismiche #define URL_SERVER_DOWNLOAD_RETI_SISMICHE @"http://srv.earthquakenetwork.it/distquake_download_automatic14.php" // Tsunami @@ -288,8 +288,3 @@ typedef enum : NSInteger { #define EQN_SISMI_FORTI @"EQN_SISMI_FORTI" #define EQN_SISMI_QUALSIASI_MAGNITUDO @"EQN_SISMI_QUALSIASI_MAGNITUDO" #define EQN_SISMI_MODIFICA_IMPOSTAZIONI @"EQN_SISMI_MODIFICA_IMPOSTAZIONI" - - -#define IS_IPHONE ( [[[UIDevice currentDevice] model] isEqualToString:@"iPhone"] ) -#define IS_HEIGHT_GTE_568 [[UIScreen mainScreen ] bounds].size.height <= 570.0f -#define IS_IPHONE_5 ( IS_IPHONE && IS_HEIGHT_GTE_568 ) diff --git a/Sources/Earthquake Network/ViewController/ReteSmartphone.m b/Sources/Earthquake Network/ViewController/ReteSmartphone.m index 56d9ab1..ccdf7b1 100644 --- a/Sources/Earthquake Network/ViewController/ReteSmartphone.m +++ b/Sources/Earthquake Network/ViewController/ReteSmartphone.m @@ -472,12 +472,10 @@ [self presentViewController:alertController animated:YES completion:nil]; } --(void)apriTwitter:(id)sender{ - - // TWITTER_LINK - +- (void)apriTwitter:(id)sender +{ UIApplication *mySafari = [UIApplication sharedApplication]; - NSURL *myURL = [[NSURL alloc]initWithString:TWITTER_LINK]; + NSURL *myURL = [[NSURL alloc]initWithString:EQNTwitterProfileUrl]; [mySafari openURL:myURL options:@{} completionHandler:nil]; }