refactor: Recreate layout for "Allerte" section
This commit is contained in:
@@ -92,10 +92,15 @@
|
||||
DC3ADD3924CB2F3D00737919 /* alert_star_trek.wav in Resources */ = {isa = PBXBuildFile; fileRef = 8CF12CC721DE43A400613AC5 /* alert_star_trek.wav */; };
|
||||
DC3BA11124D1A9C90062EE7F /* SubscriptionsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC3BA11024D1A9C90062EE7F /* SubscriptionsViewController.swift */; };
|
||||
DC3CE50A250EB7A8005A7DD5 /* EQNGenericPickerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC3CE509250EB7A8005A7DD5 /* EQNGenericPickerViewController.swift */; };
|
||||
DC47D1BC252A0C2B004119F6 /* AlertsPastEartquakesTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC47D1BB252A0C2B004119F6 /* AlertsPastEartquakesTableViewCell.swift */; };
|
||||
DC4B67612517833F00634277 /* EQNSeismic.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC4B67602517833F00634277 /* EQNSeismic.swift */; };
|
||||
DC52B8A224FC145500ABEBA6 /* SettingsBaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DC52B8A124FC145500ABEBA6 /* SettingsBaseViewController.m */; };
|
||||
DC52B8A524FCCD6900ABEBA6 /* AppTheme.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC52B8A424FCCD6900ABEBA6 /* AppTheme.swift */; };
|
||||
DC646F27252B694A000AA5FD /* AlertsSeismicNotificationExpandedTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC646F26252B694A000AA5FD /* AlertsSeismicNotificationExpandedTableViewCell.swift */; };
|
||||
DC646F32252B698B000AA5FD /* AlertsSeismicNotificationCompactTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC646F31252B698B000AA5FD /* AlertsSeismicNotificationCompactTableViewCell.swift */; };
|
||||
DC65B391250F243E00251693 /* SeismicSettingsNetworksViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC65B390250F243E00251693 /* SeismicSettingsNetworksViewController.swift */; };
|
||||
DC7EEE4A252A11C9004B4A2A /* AlertsSmartphoneNetworkTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC7EEE49252A11C9004B4A2A /* AlertsSmartphoneNetworkTableViewCell.swift */; };
|
||||
DC7EEE4F252A1634004B4A2A /* AlertsPriorityServiceTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC7EEE4E252A1634004B4A2A /* AlertsPriorityServiceTableViewCell.swift */; };
|
||||
DC886A5D24E92D5500F7A5D3 /* EQNBaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DC886A5C24E92D5500F7A5D3 /* EQNBaseViewController.m */; };
|
||||
DC974AFF251748B300A139EC /* SeismicFiltersViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC974AFE251748B300A139EC /* SeismicFiltersViewController.swift */; };
|
||||
DC99A50324E66E270071BC9F /* EQNCommandProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC99A50224E66E270071BC9F /* EQNCommandProtocol.swift */; };
|
||||
@@ -109,6 +114,7 @@
|
||||
DCBB267C24D1E98300F04559 /* EQNBaseTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCBB267B24D1E98300F04559 /* EQNBaseTableViewCell.swift */; };
|
||||
DCBB267E24D1EA2000F04559 /* SubscriptionProductTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCBB267D24D1EA2000F04559 /* SubscriptionProductTableViewCell.swift */; };
|
||||
DCBB268024D1ECE200F04559 /* SubscriptionDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCBB267F24D1ECE200F04559 /* SubscriptionDetailViewController.swift */; };
|
||||
DCBB84F0252CFC4600F12633 /* AlertsNoLocationTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCBB84EF252CFC4600F12633 /* AlertsNoLocationTableViewCell.swift */; };
|
||||
DCC23DEC24D281CE003A2404 /* SubscriptionsActiveTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCC23DEB24D281CE003A2404 /* SubscriptionsActiveTableViewCell.swift */; };
|
||||
DCC23DEF24D28F58003A2404 /* EQNEdgeInsetLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCC23DEE24D28F58003A2404 /* EQNEdgeInsetLabel.swift */; };
|
||||
DCC76BD8251F56050005C4DC /* SeismicCardSettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCC76BD7251F56050005C4DC /* SeismicCardSettingsViewController.swift */; };
|
||||
@@ -287,11 +293,16 @@
|
||||
DC3BA11024D1A9C90062EE7F /* SubscriptionsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionsViewController.swift; sourceTree = "<group>"; };
|
||||
DC3CE509250EB7A8005A7DD5 /* EQNGenericPickerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EQNGenericPickerViewController.swift; sourceTree = "<group>"; };
|
||||
DC414C0024CDA09A008D9AE4 /* CHANGELOG.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = CHANGELOG.md; path = ../CHANGELOG.md; sourceTree = "<group>"; };
|
||||
DC47D1BB252A0C2B004119F6 /* AlertsPastEartquakesTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertsPastEartquakesTableViewCell.swift; sourceTree = "<group>"; };
|
||||
DC4B67602517833F00634277 /* EQNSeismic.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EQNSeismic.swift; sourceTree = "<group>"; };
|
||||
DC52B8A024FC145500ABEBA6 /* SettingsBaseViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SettingsBaseViewController.h; sourceTree = "<group>"; };
|
||||
DC52B8A124FC145500ABEBA6 /* SettingsBaseViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SettingsBaseViewController.m; sourceTree = "<group>"; };
|
||||
DC52B8A424FCCD6900ABEBA6 /* AppTheme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppTheme.swift; sourceTree = "<group>"; };
|
||||
DC646F26252B694A000AA5FD /* AlertsSeismicNotificationExpandedTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertsSeismicNotificationExpandedTableViewCell.swift; sourceTree = "<group>"; };
|
||||
DC646F31252B698B000AA5FD /* AlertsSeismicNotificationCompactTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertsSeismicNotificationCompactTableViewCell.swift; sourceTree = "<group>"; };
|
||||
DC65B390250F243E00251693 /* SeismicSettingsNetworksViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SeismicSettingsNetworksViewController.swift; sourceTree = "<group>"; };
|
||||
DC7EEE49252A11C9004B4A2A /* AlertsSmartphoneNetworkTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertsSmartphoneNetworkTableViewCell.swift; sourceTree = "<group>"; };
|
||||
DC7EEE4E252A1634004B4A2A /* AlertsPriorityServiceTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertsPriorityServiceTableViewCell.swift; sourceTree = "<group>"; };
|
||||
DC886A5B24E92D5500F7A5D3 /* EQNBaseViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EQNBaseViewController.h; sourceTree = "<group>"; };
|
||||
DC886A5C24E92D5500F7A5D3 /* EQNBaseViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EQNBaseViewController.m; sourceTree = "<group>"; };
|
||||
DC974AFE251748B300A139EC /* SeismicFiltersViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SeismicFiltersViewController.swift; sourceTree = "<group>"; };
|
||||
@@ -306,6 +317,7 @@
|
||||
DCBB267B24D1E98300F04559 /* EQNBaseTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EQNBaseTableViewCell.swift; sourceTree = "<group>"; };
|
||||
DCBB267D24D1EA2000F04559 /* SubscriptionProductTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionProductTableViewCell.swift; sourceTree = "<group>"; };
|
||||
DCBB267F24D1ECE200F04559 /* SubscriptionDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionDetailViewController.swift; sourceTree = "<group>"; };
|
||||
DCBB84EF252CFC4600F12633 /* AlertsNoLocationTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertsNoLocationTableViewCell.swift; sourceTree = "<group>"; };
|
||||
DCC23DEB24D281CE003A2404 /* SubscriptionsActiveTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionsActiveTableViewCell.swift; sourceTree = "<group>"; };
|
||||
DCC23DEE24D28F58003A2404 /* EQNEdgeInsetLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EQNEdgeInsetLabel.swift; sourceTree = "<group>"; };
|
||||
DCC76BD7251F56050005C4DC /* SeismicCardSettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SeismicCardSettingsViewController.swift; sourceTree = "<group>"; };
|
||||
@@ -634,6 +646,29 @@
|
||||
path = Shared;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
DC47D1B9252A0C08004119F6 /* Alerts */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8CBD3DC82149B9AD0070C963 /* AllerteViewController.h */,
|
||||
8CBD3DC92149B9AD0070C963 /* AllerteViewController.m */,
|
||||
DC47D1BA252A0C0E004119F6 /* Cells */,
|
||||
);
|
||||
path = Alerts;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
DC47D1BA252A0C0E004119F6 /* Cells */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
DCBB84EF252CFC4600F12633 /* AlertsNoLocationTableViewCell.swift */,
|
||||
DC646F26252B694A000AA5FD /* AlertsSeismicNotificationExpandedTableViewCell.swift */,
|
||||
DC646F31252B698B000AA5FD /* AlertsSeismicNotificationCompactTableViewCell.swift */,
|
||||
DC47D1BB252A0C2B004119F6 /* AlertsPastEartquakesTableViewCell.swift */,
|
||||
DC7EEE49252A11C9004B4A2A /* AlertsSmartphoneNetworkTableViewCell.swift */,
|
||||
DC7EEE4E252A1634004B4A2A /* AlertsPriorityServiceTableViewCell.swift */,
|
||||
);
|
||||
path = Cells;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
DC99A50124E66DFB0071BC9F /* Commands */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -673,9 +708,8 @@
|
||||
DC886A5C24E92D5500F7A5D3 /* EQNBaseViewController.m */,
|
||||
8C5EA23B2177B51C002DC156 /* SegnalazioniViewController.h */,
|
||||
8C5EA23C2177B51C002DC156 /* SegnalazioniViewController.m */,
|
||||
8CBD3DC82149B9AD0070C963 /* AllerteViewController.h */,
|
||||
8CBD3DC92149B9AD0070C963 /* AllerteViewController.m */,
|
||||
DC3CE508250EB78C005A7DD5 /* Shared */,
|
||||
DC47D1B9252A0C08004119F6 /* Alerts */,
|
||||
DCD3E3BE24D1555F007C78D4 /* InApp */,
|
||||
DCEFF21024F57163009D3FE1 /* Settings */,
|
||||
DC141968250E769B0059E060 /* Seismic Networks */,
|
||||
@@ -1066,11 +1100,13 @@
|
||||
8C593E8A217BA2470008B260 /* EQNSegnalazione.m in Sources */,
|
||||
DCBB267C24D1E98300F04559 /* EQNBaseTableViewCell.swift in Sources */,
|
||||
8CBD3DCA2149B9AD0070C963 /* AllerteViewController.m in Sources */,
|
||||
DC646F32252B698B000AA5FD /* AlertsSeismicNotificationCompactTableViewCell.swift in Sources */,
|
||||
DCF10DCD24D2C935009F34C3 /* EQNPurchaseAvailability.swift in Sources */,
|
||||
DC08803F24F5A89000186D97 /* SettingEnableTableViewCell.swift in Sources */,
|
||||
8CAFD7C521825E4A00F8BD29 /* EQNSisma.m in Sources */,
|
||||
DCC23DEC24D281CE003A2404 /* SubscriptionsActiveTableViewCell.swift in Sources */,
|
||||
8CF6604F214C0E58009F4314 /* EQNCalibrazione.m in Sources */,
|
||||
DCBB84F0252CFC4600F12633 /* AlertsNoLocationTableViewCell.swift in Sources */,
|
||||
DCD3E3C024D15576007C78D4 /* PurchaseProVersionViewController.swift in Sources */,
|
||||
8C2B25142193927E00E0E25E /* ReteSismiDettagliMappa.m in Sources */,
|
||||
8CF05B51218C41FB0055012B /* PickerViewController.m in Sources */,
|
||||
@@ -1079,6 +1115,7 @@
|
||||
DCF10DC624D2B8C7009F34C3 /* EQNPurchaseUtility.swift in Sources */,
|
||||
8C2B251121938BFD00E0E25E /* SegnalazioniUtenteDettagliMappa.m in Sources */,
|
||||
DC0E551324F8063300D54270 /* SettingSegmentedTableViewCell.swift in Sources */,
|
||||
DC47D1BC252A0C2B004119F6 /* AlertsPastEartquakesTableViewCell.swift in Sources */,
|
||||
DCEFF21724F58569009D3FE1 /* SettingSectionHeaderView.swift in Sources */,
|
||||
8C14113121ED3E5B00A59729 /* SettingsRealTimeAlertsViewController.m in Sources */,
|
||||
DCBB267A24D1E7F500F04559 /* SubscriptionsHeaderTableViewCell.swift in Sources */,
|
||||
@@ -1091,6 +1128,8 @@
|
||||
8C7A3B66225A5EA40045B266 /* NSDictionary+EQNExtensions.m in Sources */,
|
||||
8CF66053214C12DC009F4314 /* EQNMath.m in Sources */,
|
||||
DCF4A54524F8DB8300B17326 /* SettingDateTableViewCell.swift in Sources */,
|
||||
DC7EEE4A252A11C9004B4A2A /* AlertsSmartphoneNetworkTableViewCell.swift in Sources */,
|
||||
DC7EEE4F252A1634004B4A2A /* AlertsPriorityServiceTableViewCell.swift in Sources */,
|
||||
8C60224A218EDBE200C799C2 /* PastquakesAnnotation.m in Sources */,
|
||||
8CC1B15A217CB09100F22178 /* DettagliMappaViewController.m in Sources */,
|
||||
8C5EA23D2177B51C002DC156 /* SegnalazioniViewController.m in Sources */,
|
||||
@@ -1108,6 +1147,7 @@
|
||||
8C8EBBA721540039002784BA /* EQNUser.m in Sources */,
|
||||
8CADAA9421B2627D0044E256 /* LogViewController.m in Sources */,
|
||||
DC3BA11124D1A9C90062EE7F /* SubscriptionsViewController.swift in Sources */,
|
||||
DC646F27252B694A000AA5FD /* AlertsSeismicNotificationExpandedTableViewCell.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
||||
@@ -9,13 +9,11 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@class EQNMainTabBarController;
|
||||
@class AllerteViewController;
|
||||
|
||||
@interface AppDelegate : UIResponder <UIApplicationDelegate>
|
||||
|
||||
@property (strong, nonatomic) UIWindow *window;
|
||||
@property (weak, nonatomic) EQNMainTabBarController *mainTabBarController;
|
||||
@property (weak, nonatomic) AllerteViewController *reteSmartphone;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -0,0 +1,325 @@
|
||||
//
|
||||
// AllerteViewController.m
|
||||
// Earthquake Network
|
||||
//
|
||||
// Refactored by Andrea Busi on 04/10/2020
|
||||
// Copyright © 2020 Earthquake Network. All rights reserved.
|
||||
//
|
||||
|
||||
#import "AllerteViewController.h"
|
||||
#import "Costanti.h"
|
||||
#import "ServerRequest.h"
|
||||
#import "EQNManager.h"
|
||||
#import "PastquakesDettagliMappa.h"
|
||||
#import "PastquakesAnnotation.h"
|
||||
#import "EQNUser.h"
|
||||
#import "AppDelegate.h"
|
||||
#import "EQNAreaCheck.h"
|
||||
@import StoreKit;
|
||||
@import SafariServices;
|
||||
@import CoreLocation;
|
||||
@import GoogleMobileAds;
|
||||
|
||||
@interface AllerteViewController () <UITableViewDelegate, UITableViewDataSource>
|
||||
@property (weak, nonatomic) IBOutlet UITableView *tableView;
|
||||
@property (strong, nonatomic) NSMutableArray *tableItems;
|
||||
@property (nonatomic) BOOL isNotificaAttiva;
|
||||
@end
|
||||
|
||||
@implementation AllerteViewController
|
||||
|
||||
static NSString * const SegueIdentifierProVersion = @"ShowProVersion";
|
||||
static NSString * const SegueIdentifierPrioritySubscriptions = @"ShowPrioritySubscriptions";
|
||||
static NSString * const SegueIdentifierMap = @"ShowMap";
|
||||
|
||||
/// Sections inside the app
|
||||
typedef NS_ENUM(NSInteger, AllerteTableRow) {
|
||||
AllerteTableRowLocationPermission = 0,
|
||||
AllerteTableRowSismiRilevati,
|
||||
AllerteTableRowAllertePassate,
|
||||
AllerteTableRowReteSmartphone,
|
||||
AllerteTableRowServizioPriorita,
|
||||
AllerteTableRowVersionePro
|
||||
};
|
||||
|
||||
#pragma mark - Accessories
|
||||
|
||||
- (NSMutableArray *)tableItems
|
||||
{
|
||||
if (!_tableItems) {
|
||||
_tableItems = [[NSMutableArray alloc] init];
|
||||
}
|
||||
return _tableItems;
|
||||
}
|
||||
|
||||
#pragma mark - View Lifecycle
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
|
||||
[self setupUI];
|
||||
[self refreshUI];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(applicationWillEnterForegroundNotification:)
|
||||
name:UIApplicationWillEnterForegroundNotification
|
||||
object:nil];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(didChangeAuthorizationStatusNotification:)
|
||||
name:EQNNotificationDidChangeAuthorizationStatus
|
||||
object:nil];
|
||||
}
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated
|
||||
{
|
||||
[super viewWillAppear:animated];
|
||||
|
||||
[self refreshUI];
|
||||
}
|
||||
|
||||
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
|
||||
{
|
||||
if ([segue.identifier isEqualToString:SegueIdentifierMap]) {
|
||||
UINavigationController *controller = (UINavigationController *)segue.destinationViewController;
|
||||
PastquakesDettagliMappa *dettagliMappa = (PastquakesDettagliMappa *)controller.topViewController;
|
||||
dettagliMappa.tipoMappa = reteSmartphone;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Notification
|
||||
|
||||
- (void)applicationWillEnterForegroundNotification:(NSNotification *)notification
|
||||
{
|
||||
[self refreshUI];
|
||||
}
|
||||
|
||||
- (void)didChangeAuthorizationStatusNotification:(NSNotification *)notification
|
||||
{
|
||||
[self refreshUI];
|
||||
}
|
||||
|
||||
#pragma mark - Public
|
||||
|
||||
- (void)fetchNewDataWithCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
|
||||
{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self refreshUI];
|
||||
});
|
||||
completionHandler(UIBackgroundFetchResultNewData);
|
||||
}
|
||||
|
||||
#pragma mark - Private
|
||||
|
||||
- (void)setupUI
|
||||
{
|
||||
self.title = NSLocalizedString(@"tab_network", nil);
|
||||
self.tableView.estimatedRowHeight = 200.0;
|
||||
self.tableView.rowHeight = UITableViewAutomaticDimension;
|
||||
}
|
||||
|
||||
- (void)refreshUI
|
||||
{
|
||||
[super refreshUI];
|
||||
|
||||
NSDate *date = [[NSUserDefaults standardUserDefaults] objectForKey:NOTIFICHE_RETE_SMARTPHONE_DATA_NOTIFICA];
|
||||
if (date) {
|
||||
if ([EQNUtility getDifferenceMinute:date] < TEMPO_VISUALIZZAZIONE_NOTIFICA)
|
||||
self.isNotificaAttiva = YES;
|
||||
else{
|
||||
self.isNotificaAttiva = NO;
|
||||
[[NSUserDefaults standardUserDefaults] removeObjectForKey:NOTIFICHE_RETE_SMARTPHONE_DATA_NOTIFICA];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
}
|
||||
|
||||
[self.tableItems removeAllObjects];
|
||||
|
||||
// check if locations is enabled
|
||||
if (CLLocationManager.authorizationStatus != kCLAuthorizationStatusAuthorizedAlways) {
|
||||
[self.tableItems addObject:@(AllerteTableRowLocationPermission)];
|
||||
}
|
||||
// always visible rows
|
||||
[self.tableItems addObjectsFromArray:@[ @(AllerteTableRowSismiRilevati), @(AllerteTableRowAllertePassate), @(AllerteTableRowReteSmartphone), @(AllerteTableRowServizioPriorita)]];
|
||||
// pro cell visible only if user hasn't already bought the app
|
||||
if ([EQNPurchaseUtility isProVersionEnabled] == NO) {
|
||||
[self.tableItems addObject:@(AllerteTableRowVersionePro)];
|
||||
}
|
||||
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
#pragma mark - Actions
|
||||
|
||||
- (IBAction)refreshDataTapped:(id)sender
|
||||
{
|
||||
[[EQNManager defaultManager] sincronizza];
|
||||
}
|
||||
|
||||
- (void)actionCloseNotification
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] removeObjectForKey:NOTIFICHE_RETE_SMARTPHONE_DATA_NOTIFICA];
|
||||
[[NSUserDefaults standardUserDefaults] removeObjectForKey:NOTIFICHE_RETE_SMARTPHONE_DIZIONARIO_NOTIFICA];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
self.isNotificaAttiva = NO;
|
||||
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
- (void)actionShareApp
|
||||
{
|
||||
NSString *appName = [NSProcessInfo processInfo].processName;
|
||||
NSString *content = [NSString stringWithFormat:@"%@%@ %@",NSLocalizedString(@"Scarica ", @""), appName, EQNAppStoreUrl];
|
||||
|
||||
UIActivityViewController* activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[content]
|
||||
applicationActivities:nil];
|
||||
[self presentViewController:activityViewController animated:YES completion:nil];
|
||||
}
|
||||
|
||||
- (void)actionRateApp
|
||||
{
|
||||
[SKStoreReviewController requestReview];
|
||||
}
|
||||
|
||||
- (void)actionOpenTwitter
|
||||
{
|
||||
NSURL *twitterUrl = [NSURL URLWithString:EQNTwitterProfileUrl];
|
||||
SFSafariViewController *controller = [[SFSafariViewController alloc] initWithURL:twitterUrl];
|
||||
[self presentViewController:controller animated:YES completion:nil];
|
||||
}
|
||||
|
||||
- (void)actionComingSoon
|
||||
{
|
||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Coming soon..." message:@"🚀" preferredStyle:UIAlertControllerStyleAlert];
|
||||
[alert addAction:[UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleDefault handler:nil]];
|
||||
[self presentViewController:alert animated:YES completion:nil];
|
||||
}
|
||||
|
||||
- (void)actionHowItWorks
|
||||
{
|
||||
NSURL *youtubeUrl = [NSURL URLWithString:NSLocalizedString(@"youtube_video", nil)];
|
||||
SFSafariViewController *controller = [[SFSafariViewController alloc] initWithURL:youtubeUrl];
|
||||
[self presentViewController:controller animated:YES completion:nil];
|
||||
}
|
||||
|
||||
#pragma table view
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
||||
{
|
||||
return self.tableItems.count;
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
AllerteTableRow tableRow = [self.tableItems[indexPath.row] integerValue];
|
||||
|
||||
if (tableRow == AllerteTableRowLocationPermission) {
|
||||
AlertsNoLocationTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"NoLocationCell" forIndexPath:indexPath];
|
||||
cell.status = CLLocationManager.authorizationStatus;
|
||||
return cell;
|
||||
|
||||
} else if (tableRow == AllerteTableRowSismiRilevati) {
|
||||
if (self.isNotificaAttiva) {
|
||||
AlertsSeismicNotificationExpandedTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SeismicNotificationExpandedCell" forIndexPath:indexPath];
|
||||
NSDictionary *info = [EQNUtility readDictyWithCustomObjFromUserDefaults:NOTIFICHE_RETE_SMARTPHONE_DIZIONARIO_NOTIFICA];
|
||||
cell.notification = info;
|
||||
|
||||
__weak AllerteViewController *weakSelf = self;
|
||||
cell.onTapClose = ^{
|
||||
[weakSelf actionCloseNotification];
|
||||
};
|
||||
cell.onTapShareApp = ^{
|
||||
[weakSelf actionShareApp];
|
||||
};
|
||||
cell.onTapRateApp = ^{
|
||||
[weakSelf actionRateApp];
|
||||
};
|
||||
cell.onTapOpenTwitter = ^{
|
||||
[weakSelf actionOpenTwitter];
|
||||
};
|
||||
|
||||
return cell;
|
||||
}
|
||||
|
||||
AlertsSeismicNotificationCompactTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SeismicNotificationCell" forIndexPath:indexPath];
|
||||
|
||||
__weak AllerteViewController *weakSelf = self;
|
||||
cell.onTapAlertTest = ^{
|
||||
[weakSelf actionComingSoon];
|
||||
};
|
||||
cell.onTapSimulator = ^{
|
||||
[weakSelf actionComingSoon];
|
||||
};
|
||||
cell.onTapHowItWorks = ^{
|
||||
[weakSelf actionHowItWorks];
|
||||
};
|
||||
cell.onTapShareApp = ^{
|
||||
[weakSelf actionShareApp];
|
||||
};
|
||||
|
||||
return cell;
|
||||
|
||||
} else if (tableRow == AllerteTableRowAllertePassate) {
|
||||
AlertsPastEartquakesTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"PastEarthquakesCell" forIndexPath:indexPath];
|
||||
cell.smartphoneNetwork = [EQNManager defaultManager].rete_smartphone;
|
||||
cell.onTapMapButton = ^{
|
||||
[self performSegueWithIdentifier:SegueIdentifierMap sender:nil];
|
||||
};
|
||||
return cell;
|
||||
|
||||
} else if (tableRow == AllerteTableRowReteSmartphone) {
|
||||
AlertsSmartphoneNetworkTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SmartphoneNetworkCell" forIndexPath:indexPath];
|
||||
cell.smartphoneNetwork = [EQNManager defaultManager].rete_smartphone;
|
||||
cell.onTapButton = ^{
|
||||
[self visualizzaCopertura];
|
||||
};
|
||||
return cell;
|
||||
|
||||
} else if (tableRow == AllerteTableRowServizioPriorita) {
|
||||
AlertsPriorityServiceTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"PriorityCell" forIndexPath:indexPath];
|
||||
cell.smartphoneNetwork = [EQNManager defaultManager].rete_smartphone;
|
||||
return cell;
|
||||
|
||||
} else if (tableRow == AllerteTableRowVersionePro) {
|
||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ProVersionCell" forIndexPath:indexPath];
|
||||
return cell;
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
|
||||
AllerteTableRow tableRow = [self.tableItems[indexPath.row] integerValue];
|
||||
switch (tableRow) {
|
||||
case AllerteTableRowServizioPriorita:
|
||||
[self performSegueWithIdentifier:SegueIdentifierPrioritySubscriptions sender:nil];
|
||||
break;
|
||||
case AllerteTableRowVersionePro:
|
||||
[self performSegueWithIdentifier:SegueIdentifierProVersion sender:nil];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)visualizzaCopertura
|
||||
{
|
||||
[[EQNManager defaultManager] sincronizza];
|
||||
EQNAreaCheck *areaCheck = [EQNManager defaultManager].area_check;
|
||||
|
||||
UIAlertController * alertController = [UIAlertController
|
||||
alertControllerWithTitle:NSLocalizedString(@"Copertura" , @"")
|
||||
message:[NSString stringWithFormat:@"%@ %@ %@", NSLocalizedString(@"Dispositivi totali", @""), areaCheck.total, NSLocalizedString(@"Dispositivi attivi", @"")]
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
[alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"OK" ,@"")
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:nil]];
|
||||
[self presentViewController:alertController animated:YES completion:nil];
|
||||
}
|
||||
|
||||
@end
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// AlertsNoLocationTableViewCell.swift
|
||||
// Earthquake Network
|
||||
//
|
||||
// Created by Busi Andrea on 06/10/2020.
|
||||
// Copyright © 2020 Earthquake Network. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import CoreLocation
|
||||
|
||||
class AlertsNoLocationTableViewCell: UITableViewCell {
|
||||
|
||||
@objc var status: CLAuthorizationStatus = .notDetermined {
|
||||
didSet {
|
||||
updateUI()
|
||||
}
|
||||
}
|
||||
|
||||
@IBOutlet private weak var messageLabel: UILabel!
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
private func updateUI() {
|
||||
var message = ""
|
||||
switch status {
|
||||
case .authorizedAlways:
|
||||
message = ""
|
||||
case .authorizedWhenInUse:
|
||||
message = NSLocalizedString("permission_location_no_background", comment: "")
|
||||
default:
|
||||
message = NSLocalizedString("permission_location_no", comment: "")
|
||||
}
|
||||
messageLabel.text = message
|
||||
}
|
||||
|
||||
// MARK: - Actions
|
||||
|
||||
@IBAction private func solveTapped(_ sender: UIButton) {
|
||||
guard let settingsUrl = URL(string: UIApplication.openSettingsURLString) else {
|
||||
return
|
||||
}
|
||||
|
||||
UIApplication.shared.open(settingsUrl, options: [:], completionHandler: nil)
|
||||
}
|
||||
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// AlertsPastEartquakesTableViewCell.swift
|
||||
// Earthquake Network
|
||||
//
|
||||
// Created by Busi Andrea on 04/10/2020.
|
||||
// Copyright © 2020 Earthquake Network. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class AlertsPastEartquakesTableViewCell: UITableViewCell {
|
||||
|
||||
@objc var smartphoneNetwork: EQNReteSmartphone? {
|
||||
didSet {
|
||||
updateUI()
|
||||
}
|
||||
}
|
||||
|
||||
@objc var onTapMapButton: (() -> Void)?
|
||||
|
||||
// MARK: - Internal
|
||||
|
||||
@IBOutlet private weak var last24hLabel: UILabel!
|
||||
@IBOutlet private weak var from2013Label: UILabel!
|
||||
@IBOutlet private weak var mapButton: UIButton!
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
private func updateUI() {
|
||||
guard let smartphoneNetwork = smartphoneNetwork else { return }
|
||||
|
||||
last24hLabel.text = smartphoneNetwork.eq;
|
||||
from2013Label.text = smartphoneNetwork.eq_p;
|
||||
}
|
||||
|
||||
// MARK: - Actions
|
||||
|
||||
@IBAction func mapTapped(_ sender: UIButton) {
|
||||
onTapMapButton?()
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// AlertsPriorityServiceTableViewCell.swift
|
||||
// Earthquake Network
|
||||
//
|
||||
// Created by Busi Andrea on 04/10/2020.
|
||||
// Copyright © 2020 Earthquake Network. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class AlertsPriorityServiceTableViewCell: UITableViewCell {
|
||||
|
||||
@objc var smartphoneNetwork: EQNReteSmartphone? {
|
||||
didSet {
|
||||
updateUI()
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Internal
|
||||
|
||||
@IBOutlet private weak var lastSubscriptionLabel: UILabel!
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
private func updateUI() {
|
||||
guard let smartphoneNetwork = smartphoneNetwork, let minutes = Int(smartphoneNetwork.diff) else { return }
|
||||
|
||||
let formattedTime = EQNUtility.formattedString(forTimeDifference: minutes)
|
||||
lastSubscriptionLabel.text = String(format: NSLocalizedString("inapp_adv", comment: ""), formattedTime)
|
||||
}
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// AlertsSeismicNotificationCompactTableViewCell.swift
|
||||
// Earthquake Network
|
||||
//
|
||||
// Created by Busi Andrea on 05/10/2020.
|
||||
// Copyright © 2020 Earthquake Network. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class AlertsSeismicNotificationCompactTableViewCell: UITableViewCell {
|
||||
|
||||
typealias DefaultCompletion = () -> Void
|
||||
|
||||
@objc var onTapAlertTest: DefaultCompletion?
|
||||
@objc var onTapSimulator: DefaultCompletion?
|
||||
@objc var onTapHowItWorks: DefaultCompletion?
|
||||
@objc var onTapShareApp: DefaultCompletion?
|
||||
|
||||
// MARK: - Actions
|
||||
|
||||
@IBAction private func testAlertTapped() {
|
||||
onTapAlertTest?()
|
||||
}
|
||||
|
||||
@IBAction private func simulatorTapped() {
|
||||
onTapSimulator?()
|
||||
}
|
||||
|
||||
@IBAction private func howItWorksTapped() {
|
||||
onTapHowItWorks?()
|
||||
}
|
||||
|
||||
@IBAction private func shareAppTapped() {
|
||||
onTapShareApp?()
|
||||
}
|
||||
}
|
||||
+129
@@ -0,0 +1,129 @@
|
||||
//
|
||||
// AlertsSeismicNotificationTableViewCell.swift
|
||||
// Earthquake Network
|
||||
//
|
||||
// Created by Busi Andrea on 05/10/2020.
|
||||
// Copyright © 2020 Earthquake Network. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import MapKit
|
||||
|
||||
class AlertsSeismicNotificationExpandedTableViewCell: UITableViewCell, MKMapViewDelegate {
|
||||
|
||||
typealias DefaultCompletion = () -> Void
|
||||
|
||||
@objc var notification: [String: Any]? {
|
||||
didSet {
|
||||
updateUI()
|
||||
}
|
||||
}
|
||||
@objc var onTapOpenTwitter: DefaultCompletion?
|
||||
@objc var onTapRateApp: DefaultCompletion?
|
||||
@objc var onTapClose: DefaultCompletion?
|
||||
@objc var onTapShareApp: DefaultCompletion?
|
||||
|
||||
|
||||
// MARK: - Internal
|
||||
|
||||
@IBOutlet weak var containerView: UIView!
|
||||
@IBOutlet weak var notificationTitleLabel: UILabel!
|
||||
@IBOutlet weak var notificationDescriptionLabel: UILabel!
|
||||
@IBOutlet weak var mapView: MKMapView! {
|
||||
didSet {
|
||||
mapView.delegate = self
|
||||
mapView.isScrollEnabled = false
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
private func updateUI() {
|
||||
notificationTitleLabel.text = ""
|
||||
notificationDescriptionLabel.text = ""
|
||||
|
||||
guard let notification = notification,
|
||||
let aps = notification["aps"] as? [String: Any],
|
||||
let alert = aps["alert"] as? [String: Any] else { return }
|
||||
|
||||
var intensity = -1
|
||||
if let intensityString = notification["intensity"] as? String, let anIntensity = Int(intensityString) {
|
||||
intensity = anIntensity
|
||||
}
|
||||
containerView.backgroundColor = color(for: intensity)
|
||||
|
||||
if let title = alert["loc-key"] as? String, let args = alert["loc-args"] as? [String], let arg = args.first {
|
||||
notificationTitleLabel.text = String(format: NSLocalizedString(title, comment: ""), arg)
|
||||
}
|
||||
if let location = notification["location"],
|
||||
let counter = notification["counter"],
|
||||
let dateString = notification["datetime"] as? String,
|
||||
let date = EQNUtility.getDateFrom(dateString) {
|
||||
|
||||
let difference = Int(NSDate().timeIntervalSince(date) / 60.0)
|
||||
|
||||
notificationDescriptionLabel.text = ""
|
||||
+ NSLocalizedString("Distanza", comment: "") + " \(location)"
|
||||
+ " - " + EQNUtility.formattedString(forTimeDifference: difference)
|
||||
+ "\n" + String(format: NSLocalizedString("map_number", comment: ""), "\(counter)")
|
||||
}
|
||||
|
||||
if let latitudeString = notification["latitude"] as? String,
|
||||
let latitude = Double(latitudeString),
|
||||
let longitudeString = notification["longitude"] as? String,
|
||||
let longitude = Double(longitudeString) {
|
||||
|
||||
let coordinate = CLLocation(latitude: latitude, longitude: longitude)
|
||||
let span = MKCoordinateSpan(latitudeDelta: 10.5, longitudeDelta: 10.5)
|
||||
let region = MKCoordinateRegion(center: coordinate.coordinate, span: span)
|
||||
|
||||
mapView.setCenter(coordinate.coordinate, animated: false)
|
||||
mapView.setRegion(region, animated: true)
|
||||
|
||||
let annotation = PastquakesAnnotation(title: "", location: coordinate.coordinate, intensita: intensity)
|
||||
mapView.addAnnotation(annotation)
|
||||
}
|
||||
}
|
||||
|
||||
func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
|
||||
guard let annotation = annotation as? PastquakesAnnotation else {
|
||||
return nil
|
||||
}
|
||||
|
||||
var annotationView = mapView.dequeueReusableAnnotationView(withIdentifier: IDENTIFIER_ANNOTATION_PASTQUAKES)
|
||||
if annotationView == nil {
|
||||
annotationView = annotation.annotationView()
|
||||
} else {
|
||||
annotationView?.annotation = annotation
|
||||
}
|
||||
|
||||
return annotationView
|
||||
}
|
||||
|
||||
private func color(for intensity: Int) -> UIColor? {
|
||||
switch intensity {
|
||||
case 0: return UIColor(red: 208.0/255.0, green: 234.0/255.0, blue: 201.0/255.0, alpha:1.0)
|
||||
case 1: return UIColor(red: 254.0/255.0, green: 252.0/255.0, blue: 203.0/255.0, alpha:1.0)
|
||||
case 2: return UIColor(red: 254.0/255.0, green: 186.0/255.0, blue: 186.0/255.0, alpha:1.0)
|
||||
default: return nil
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Actions
|
||||
|
||||
@IBAction private func shareAppTapped(_ sender: UIButton) {
|
||||
onTapShareApp?()
|
||||
}
|
||||
|
||||
@IBAction private func rateAppTapped(_ sender: UIButton) {
|
||||
onTapRateApp?()
|
||||
}
|
||||
|
||||
@IBAction private func viewInTwitterTapped(_ sender: UIButton) {
|
||||
onTapOpenTwitter?()
|
||||
}
|
||||
|
||||
@IBAction private func closeTapped(_ sender: UIButton) {
|
||||
onTapClose?()
|
||||
}
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// AlertsSmartphoneNetworkTableViewCell.swift
|
||||
// Earthquake Network
|
||||
//
|
||||
// Created by Busi Andrea on 04/10/2020.
|
||||
// Copyright © 2020 Earthquake Network. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class AlertsSmartphoneNetworkTableViewCell: UITableViewCell {
|
||||
|
||||
@objc var smartphoneNetwork: EQNReteSmartphone? {
|
||||
didSet {
|
||||
updateUI()
|
||||
}
|
||||
}
|
||||
|
||||
@objc var onTapButton: (() -> Void)?
|
||||
|
||||
// MARK: - Internal
|
||||
|
||||
@IBOutlet private weak var smartphoneCounterLabel: UILabel!
|
||||
@IBOutlet private weak var localCoverageButton: UIButton!
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
private func updateUI() {
|
||||
guard let smartphoneNetwork = smartphoneNetwork else { return }
|
||||
|
||||
smartphoneCounterLabel.text = smartphoneNetwork.green.stringValue
|
||||
}
|
||||
|
||||
// MARK: - Actions
|
||||
|
||||
@IBAction private func localCovergeTapped(_ sender: UIButton) {
|
||||
onTapButton?()
|
||||
}
|
||||
}
|
||||
@@ -1,487 +0,0 @@
|
||||
//
|
||||
// AllerteViewController.m
|
||||
// Earthquake Network
|
||||
//
|
||||
// Refactored by Andrea Busi on 04/10/2020
|
||||
// Copyright © 2020 Earthquake Network. All rights reserved.
|
||||
//
|
||||
|
||||
#import "AllerteViewController.h"
|
||||
#include "math.h"
|
||||
#import "Costanti.h"
|
||||
#import "ServerRequest.h"
|
||||
#import "EQNManager.h"
|
||||
#import "PastquakesDettagliMappa.h"
|
||||
#import "PastquakesAnnotation.h"
|
||||
#import "EQNUser.h"
|
||||
#import "AppDelegate.h"
|
||||
#import "EQNAreaCheck.h"
|
||||
@import CoreMotion;
|
||||
@import StoreKit;
|
||||
@import GoogleMobileAds;
|
||||
|
||||
@interface AllerteViewController () <UITableViewDelegate, UITableViewDataSource>
|
||||
|
||||
@property (assign, nonatomic) CMAcceleration acceleration;
|
||||
@property (strong, nonatomic) CMMotionManager *motionManager;
|
||||
@property (strong, nonatomic) NSOperationQueue *queue;
|
||||
@property (nonatomic, strong) NSMutableArray *bufferAccelerometro;
|
||||
@property (nonatomic, strong) NSTimer *timer;
|
||||
@property (nonatomic, strong) NSMutableArray *listaItemTableView;
|
||||
@property (nonatomic, strong) IBOutlet UIBarButtonItem *sidebarButton;
|
||||
@property (nonatomic, strong) IBOutlet UICollectionView *collectionView;
|
||||
@property (nonatomic, strong) IBOutlet UITableView *tableView;
|
||||
@property (nonatomic, assign) BOOL isNotificaAttiva;
|
||||
@property (nonatomic, strong) NSString *testoPerUtenti;
|
||||
@property(nonatomic, strong) GADBannerView *bannerView;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *fooTable;
|
||||
|
||||
@end
|
||||
|
||||
@implementation AllerteViewController
|
||||
|
||||
#pragma mark - View Lifecycle
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshUI) name:NOTIFICA_DOWNLOAD_TERMINATO object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshUI) name:IAPHelperPurchaseNotification object:nil];
|
||||
|
||||
self.title = NSLocalizedString(@"tab_network", nil);
|
||||
|
||||
[self.tableView setContentInset:UIEdgeInsetsMake(20,0,0,0)];
|
||||
|
||||
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
|
||||
appDelegate.reteSmartphone = self;
|
||||
|
||||
self.listaItemTableView = [@[] mutableCopy];
|
||||
|
||||
NSString *appId = @"https://itunes.apple.com/app/id1449893235";
|
||||
|
||||
self.testoPerUtenti = [NSString stringWithFormat:@"%@ %@ %@", NSLocalizedString(@"testo utenti1" , @""), appId, NSLocalizedString(@"testo utenti2" , @"")];
|
||||
|
||||
[self refreshUI];
|
||||
}
|
||||
|
||||
#pragma mark - Private
|
||||
|
||||
- (void)refreshUI
|
||||
{
|
||||
[super refreshUI];
|
||||
|
||||
NSDate *date = [[NSUserDefaults standardUserDefaults] objectForKey:NOTIFICHE_RETE_SMARTPHONE_DATA_NOTIFICA];
|
||||
if (date) {
|
||||
if ([EQNUtility getDifferenceMinute:date] < TEMPO_VISUALIZZAZIONE_NOTIFICA)
|
||||
self.isNotificaAttiva = YES;
|
||||
else{
|
||||
self.isNotificaAttiva = NO;
|
||||
[[NSUserDefaults standardUserDefaults] removeObjectForKey:NOTIFICHE_RETE_SMARTPHONE_DATA_NOTIFICA];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
[self aggiornaTabella:nil];
|
||||
}
|
||||
|
||||
-(void)aggiornaTabella:(NSNotification *)notifica{
|
||||
|
||||
self.listaItemTableView = [@[@"Allerta sismica",/* NSLocalizedString(@"Dispositivo affidabile", @"item tabelle") ,*/ NSLocalizedString(@"Sismi rilevati da smartphone", @"item tabelle"), NSLocalizedString(@"Rete smartphone", @"item tabelle"), NSLocalizedString(@"Lista priorità - NUOVA!", @"item tabelle"), NSLocalizedString(@"Versione PRO", @"item tabelle"), NSLocalizedString(@"messaggio per utenti", @"item tabelle")] mutableCopy];
|
||||
|
||||
if ([EQNPurchaseUtility isProVersionEnabled]) {
|
||||
self.fooTable.constant = 0;
|
||||
[self.listaItemTableView removeObject:NSLocalizedString(@"Versione PRO", @"item tabelle")];
|
||||
}
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
|
||||
[self.tableView reloadData]; //reload table view
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
-(void)apriMappa:(id)sender{
|
||||
|
||||
[self performSegueWithIdentifier:@"dettagliMappa" sender:sender];
|
||||
}
|
||||
-(void)apriPriorita:(id)sender{
|
||||
|
||||
[self performSegueWithIdentifier:@"servizioPriorità" sender:sender];
|
||||
}
|
||||
-(void)apriVersionePRO:(id)sender{
|
||||
|
||||
[self performSegueWithIdentifier:@"passaVersionePro" sender:sender];
|
||||
}
|
||||
|
||||
-(void)chiudiNotifica:(id)sender{
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] removeObjectForKey:NOTIFICHE_RETE_SMARTPHONE_DATA_NOTIFICA];
|
||||
[[NSUserDefaults standardUserDefaults] removeObjectForKey:NOTIFICHE_RETE_SMARTPHONE_DIZIONARIO_NOTIFICA];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
self.isNotificaAttiva = NO;
|
||||
|
||||
[self.tableView reloadData];
|
||||
|
||||
}
|
||||
|
||||
- (IBAction)refreshDataTapped:(id)sender
|
||||
{
|
||||
[[EQNManager defaultManager] sincronizza];
|
||||
}
|
||||
|
||||
#pragma mark - Navigation
|
||||
|
||||
// In a storyboard-based application, you will often want to do a little preparation before navigation
|
||||
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
|
||||
|
||||
if ([segue.identifier isEqualToString:@"dettagliMappa"]) {
|
||||
|
||||
UINavigationController *controller = (UINavigationController *)segue.destinationViewController;
|
||||
PastquakesDettagliMappa *dettagliMappa = (PastquakesDettagliMappa *)controller.topViewController;
|
||||
dettagliMappa.tipoMappa = reteSmartphone;
|
||||
|
||||
}
|
||||
// Get the new view controller using [segue destinationViewController].
|
||||
// Pass the selected object to the new view controller.
|
||||
}
|
||||
#pragma table view
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
|
||||
return self.listaItemTableView.count;
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
|
||||
switch (indexPath.row) {
|
||||
case 0:
|
||||
if (self.isNotificaAttiva)
|
||||
return 480;
|
||||
return 100;
|
||||
break;
|
||||
// case 1:
|
||||
// return 50;
|
||||
break;
|
||||
case 1:
|
||||
return 124;
|
||||
break;
|
||||
case 2:
|
||||
return 140;
|
||||
break;
|
||||
case 3:
|
||||
return 127;
|
||||
break;
|
||||
case 4:{
|
||||
if (self.listaItemTableView.count == 5)
|
||||
return 250;
|
||||
return 127;
|
||||
}
|
||||
break;
|
||||
case 5:{
|
||||
if (self.listaItemTableView.count == 6)
|
||||
return 250;
|
||||
return 127;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return 127;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
|
||||
// modalita base
|
||||
switch (indexPath.row) {
|
||||
case 0:{
|
||||
if (self.isNotificaAttiva) {
|
||||
|
||||
NSDictionary *info = [EQNUtility readDictyWithCustomObjFromUserDefaults:NOTIFICHE_RETE_SMARTPHONE_DIZIONARIO_NOTIFICA];
|
||||
int intensita = [info[@"intensity"] intValue];
|
||||
UIColor *backgroudColor;
|
||||
UIColor *buttonColor;
|
||||
UIColor *buttonBackroundColor;
|
||||
|
||||
switch (intensita) {
|
||||
case 0:
|
||||
backgroudColor = COLORE_CELLA_MAGNITUTE_LEGGERA;
|
||||
buttonBackroundColor = COLORE_CELLA_MAGNITUTE_LEGGERA_ETI;
|
||||
buttonColor = COLORE_CELLA_MAGNITUTE_LEGGERA_TESTO;
|
||||
|
||||
break;
|
||||
case 1:
|
||||
backgroudColor = COLORE_CELLA_MAGNITUTE_MEDIA;
|
||||
buttonBackroundColor = COLORE_CELLA_MAGNITUTE_MEDIA_ETI;
|
||||
buttonColor = COLORE_CELLA_MAGNITUTE_MEDIA_TESTO;
|
||||
|
||||
break;
|
||||
case 2:
|
||||
backgroudColor = COLORE_CELLA_MAGNITUTE_FORTE;
|
||||
buttonBackroundColor = COLORE_CELLA_MAGNITUTE_FORTE_ETI;
|
||||
buttonColor = COLORE_CELLA_MAGNITUTE_FORTE_TESTO;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellNotifica" forIndexPath:indexPath];
|
||||
|
||||
UIView *containerView = [cell viewWithTag:1];
|
||||
containerView.backgroundColor = backgroudColor;
|
||||
|
||||
NSLog(@"Info %@", info);
|
||||
|
||||
NSString *titoloString = info[@"aps"][@"alert"][@"title-loc-key"];
|
||||
NSArray *arrayArgs = info[@"aps"][@"alert"][@"loc-args"];
|
||||
NSString *bodyString = [NSString stringWithFormat:NSLocalizedString(info[@"aps"][@"alert"][@"loc-key"], @""), info[@"aps"][@"alert"][@"loc-args"][0]];
|
||||
if (arrayArgs.count == 0){
|
||||
NSString *bodyString1 = NSLocalizedString(info[@"aps"][@"alert"][@"loc-key"], @"");
|
||||
bodyString = [bodyString1 substringToIndex:[bodyString1 length]-2];
|
||||
}
|
||||
|
||||
UILabel *titolo = (UILabel *)[containerView viewWithTag:2];
|
||||
titolo.text = NSLocalizedString(titoloString, @"");
|
||||
titolo.textColor = buttonColor;
|
||||
|
||||
|
||||
|
||||
UIButton *button = (UIButton *)[containerView viewWithTag:3];
|
||||
button.layer.cornerRadius = button.frame.size.width/2;
|
||||
[button addTarget:self action:@selector(chiudiNotifica:) forControlEvents:UIControlEventTouchUpInside];
|
||||
button.backgroundColor = buttonColor;
|
||||
|
||||
UILabel *dettagli = (UILabel *)[containerView viewWithTag:4];
|
||||
dettagli.text = bodyString;
|
||||
|
||||
MKMapView *mappa = (MKMapView *)[containerView viewWithTag:5];
|
||||
CLLocation *coordinate = [[CLLocation alloc] initWithLatitude:[info[@"latitude"] doubleValue] longitude:[info[@"longitude"] doubleValue]];
|
||||
MKCoordinateSpan span = MKCoordinateSpanMake(10.5, 10.5);
|
||||
MKCoordinateRegion region = MKCoordinateRegionMake(coordinate.coordinate, span);
|
||||
mappa.delegate = self;
|
||||
[mappa setCenterCoordinate:coordinate.coordinate animated:NO];
|
||||
[mappa setRegion:region animated:YES];
|
||||
mappa.scrollEnabled = NO;
|
||||
|
||||
PastquakesAnnotation *pasquaAnnotation = [[PastquakesAnnotation alloc] initWithTitle:info[@"title"] location:coordinate.coordinate intensita:[info[@"intensity"] intValue]];
|
||||
|
||||
[mappa addAnnotation:pasquaAnnotation];
|
||||
|
||||
UIButton *condividi = (UIButton *)[containerView viewWithTag:6];
|
||||
condividi.layer.borderWidth = 1;
|
||||
condividi.layer.borderColor = [UIColor blackColor].CGColor;
|
||||
condividi.layer.cornerRadius = 5;
|
||||
condividi.backgroundColor = buttonBackroundColor;
|
||||
[condividi setTitle:NSLocalizedString(@"CONDIVIDI", @"titolo pulsante notifica rete smartphone") forState:UIControlStateNormal];
|
||||
[condividi addTarget:self action:@selector(share:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
UIButton *votaApp = (UIButton *)[containerView viewWithTag:7];
|
||||
votaApp.layer.borderWidth = 1;
|
||||
votaApp.layer.borderColor = [UIColor blackColor].CGColor;
|
||||
votaApp.layer.cornerRadius = 5;
|
||||
votaApp.backgroundColor = buttonBackroundColor;
|
||||
[votaApp setTitle:NSLocalizedString(@"VOTA L'APP", @"titolo pulsante notifica rete smartphone") forState:UIControlStateNormal];
|
||||
[votaApp addTarget:self action:@selector(votaApp:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
UIButton *twitter = (UIButton *)[containerView viewWithTag:8];
|
||||
twitter.layer.borderWidth = 1;
|
||||
twitter.layer.borderColor = [UIColor blackColor].CGColor;
|
||||
twitter.layer.cornerRadius = 5;
|
||||
twitter.backgroundColor = buttonBackroundColor;
|
||||
[twitter setTitle:NSLocalizedString(@"VEDI IN TWITTER", @"titolo pulsante notifica rete smartphone") forState:UIControlStateNormal];
|
||||
[twitter addTarget:self action:@selector(apriTwitter:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
UILabel *NOTE = (UILabel *)[containerView viewWithTag:9];
|
||||
NOTE.text = NSLocalizedString(@"La magnitudo sarà calcola e cominicata dalla rete sismica nazionale e comparirà nella sezione Reti Sismiche dell'app.", @"");
|
||||
|
||||
return cell;
|
||||
|
||||
}
|
||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell_1" forIndexPath:indexPath];
|
||||
return cell;
|
||||
}
|
||||
break;
|
||||
/* case 1:{
|
||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell_2" forIndexPath:indexPath];
|
||||
return cell;
|
||||
}
|
||||
break;*/
|
||||
case 1:{
|
||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell_3" forIndexPath:indexPath];
|
||||
UILabel *ultime24h = (UILabel *)[cell viewWithTag:10];
|
||||
ultime24h.text = [EQNManager defaultManager].rete_smartphone.eq;
|
||||
UILabel *totali = (UILabel *)[cell viewWithTag:20];
|
||||
totali.text = [EQNManager defaultManager].rete_smartphone.eq_p;
|
||||
UIButton *mappaButton = (UIButton *)[cell viewWithTag:30];
|
||||
[mappaButton addTarget:self action:@selector(apriMappa:) forControlEvents:UIControlEventTouchDown];
|
||||
return cell;
|
||||
}
|
||||
break;
|
||||
case 2:{
|
||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell_4" forIndexPath:indexPath];
|
||||
UILabel *smartphoneAttivi = (UILabel *)[cell viewWithTag:10];
|
||||
smartphoneAttivi.text = [[EQNManager defaultManager].rete_smartphone.green stringValue];
|
||||
|
||||
UIButton *pulsante = (UIButton *)[cell viewWithTag:200];
|
||||
pulsante.layer.cornerRadius = 5;
|
||||
pulsante.layer.borderWidth = 1;
|
||||
pulsante.layer.borderColor = [UIColor blackColor].CGColor;
|
||||
[pulsante addTarget:self action:@selector(visualizzaCopertura) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
|
||||
return cell;
|
||||
}
|
||||
break;
|
||||
case 3:{
|
||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell_5" forIndexPath:indexPath];
|
||||
|
||||
UIButton *buttonPriorita = (UIButton *)[cell viewWithTag:10];
|
||||
[buttonPriorita addTarget:self action:@selector(apriPriorita:) forControlEvents:UIControlEventTouchDown];
|
||||
return cell;
|
||||
}
|
||||
break;
|
||||
case 4:{
|
||||
|
||||
if (self.listaItemTableView.count == 5){
|
||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell_7" forIndexPath:indexPath];
|
||||
|
||||
UITextView *textView = (UITextView *)[cell viewWithTag:12];
|
||||
textView.text = self.testoPerUtenti;
|
||||
|
||||
UIButton *condividi = (UIButton *)[cell viewWithTag:100];
|
||||
[condividi addTarget:self action:@selector(share:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
return cell;
|
||||
}else{
|
||||
|
||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell_6" forIndexPath:indexPath];
|
||||
|
||||
UIButton *buttonPRO = (UIButton *)[cell viewWithTag:10];
|
||||
[buttonPRO addTarget:self action:@selector(apriVersionePRO:) forControlEvents:UIControlEventTouchDown];
|
||||
return cell;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case 5:{
|
||||
if (self.listaItemTableView.count == 6){
|
||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell_7" forIndexPath:indexPath];
|
||||
|
||||
UITextView *textView = (UITextView *)[cell viewWithTag:12];
|
||||
textView.text = self.testoPerUtenti;
|
||||
|
||||
UIButton *condividi = (UIButton *)[cell viewWithTag:100];
|
||||
[condividi addTarget:self action:@selector(share:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
return cell;
|
||||
}else{
|
||||
|
||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell_6" forIndexPath:indexPath];
|
||||
|
||||
UIButton *buttonPRO = (UIButton *)[cell viewWithTag:10];
|
||||
[buttonPRO addTarget:self action:@selector(apriVersionePRO:) forControlEvents:UIControlEventTouchDown];
|
||||
return cell;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:{
|
||||
|
||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell_1" forIndexPath:indexPath];
|
||||
return cell;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
|
||||
switch (indexPath.row) {
|
||||
case 3:
|
||||
[self apriPriorita:nil];
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (void)fetchNewDataWithCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
|
||||
{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self refreshUI];
|
||||
});
|
||||
completionHandler(UIBackgroundFetchResultNewData);
|
||||
}
|
||||
|
||||
-(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation{
|
||||
|
||||
|
||||
if ([annotation isKindOfClass:[PastquakesAnnotation class]]) {
|
||||
PastquakesAnnotation *anLocation = (PastquakesAnnotation *)annotation;
|
||||
MKAnnotationView *annotationView = [mapView dequeueReusableAnnotationViewWithIdentifier:IDENTIFIER_ANNOTATION_PASTQUAKES];
|
||||
if (annotationView == nil)
|
||||
annotationView = anLocation.annotationView;
|
||||
else
|
||||
annotationView.annotation = anLocation;
|
||||
|
||||
return annotationView;
|
||||
}
|
||||
else
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)share:(id)sender {
|
||||
|
||||
NSString *appName = [NSProcessInfo processInfo].processName;
|
||||
NSString *url=@"https://itunes.apple.com/app/id1449893235?mt=8";
|
||||
NSString * title =[NSString stringWithFormat:@"%@%@ %@",NSLocalizedString(@"Scarica ", @""),appName,url];
|
||||
|
||||
[self presentViewController: [EQNUtility shareFileWithPath:title] animated:YES completion:^{}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void)visualizzaCopertura{
|
||||
|
||||
[[EQNManager defaultManager] sincronizza];
|
||||
EQNAreaCheck *areaCheck = [EQNManager defaultManager].area_check;
|
||||
|
||||
UIAlertController * alertController = [UIAlertController
|
||||
alertControllerWithTitle:NSLocalizedString(@"Copertura" , @"")
|
||||
message:[NSString stringWithFormat:@"%@ %@ %@", NSLocalizedString(@"Dispositivi totali", @""), areaCheck.total, NSLocalizedString(@"Dispositivi attivi", @"")]
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
[alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"OK" ,@"")
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:nil]];
|
||||
|
||||
[self presentViewController:alertController animated:YES completion:nil];
|
||||
}
|
||||
|
||||
- (void)apriTwitter:(id)sender
|
||||
{
|
||||
UIApplication *mySafari = [UIApplication sharedApplication];
|
||||
NSURL *myURL = [[NSURL alloc]initWithString:EQNTwitterProfileUrl];
|
||||
[mySafari openURL:myURL options:@{} completionHandler:nil];
|
||||
|
||||
}
|
||||
|
||||
-(void)votaApp:(id)sender{
|
||||
|
||||
[SKStoreReviewController requestReview];
|
||||
}
|
||||
|
||||
-(void)dealloc{
|
||||
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
|
||||
}
|
||||
@end
|
||||
@@ -18,6 +18,7 @@ static BOOL const EQNDebugPrintResponse = NO;
|
||||
|
||||
static NSString * const EQNWebsiteAddress = @"https://www.sismo.app";
|
||||
static NSString * const EQNTwitterProfileUrl = @"https://twitter.com/SismoDetector";
|
||||
static NSString * const EQNAppStoreUrl = @"https://itunes.apple.com/app/id1449893235?mt=8";
|
||||
|
||||
#pragma mark - Math Constants
|
||||
|
||||
@@ -61,6 +62,10 @@ static NSString * const EQNUserDefaultKeyOneShotShowCountry = @"EQNetwork.OneSho
|
||||
static NSString * const EQNUserDefaultLastLocation = @"EQNLast_Location";
|
||||
static NSString * const EQNUserDefaultSeismicNetworkCards = @"EQNData.RetiSismiche";
|
||||
|
||||
#pragma mark - NSNotification
|
||||
|
||||
static NSString * const EQNNotificationDidChangeAuthorizationStatus = @"EQNNotificationDidChangeAuthorizationStatus";
|
||||
|
||||
#pragma mark - Other constants
|
||||
|
||||
static NSTimeInterval const EQNSeismicDataRefreshInterval = 120.0;
|
||||
|
||||
@@ -11,3 +11,4 @@
|
||||
#import "EQNBaseViewController.h"
|
||||
#import "ReteSismiDettagliMappa.h"
|
||||
#import "SettingsBaseViewController.h"
|
||||
#import "PastquakesAnnotation.h"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -37,18 +37,12 @@
|
||||
/* Class = "UILabel"; text = "Label"; ObjectID = "6pX-89-eYU"; */
|
||||
"6pX-89-eYU.text" = "Label";
|
||||
|
||||
/* Class = "UIButton"; normalTitle = "COPERTURA LOCALE"; ObjectID = "769-Iq-JPs"; */
|
||||
"769-Iq-JPs.normalTitle" = "COBERTURA LOCAL";
|
||||
|
||||
/* Class = "UINavigationItem"; title = "Detail"; ObjectID = "76n-gb-S2z"; */
|
||||
"76n-gb-S2z.title" = "Detail";
|
||||
|
||||
/* Class = "UIButton"; normalTitle = "METEO"; ObjectID = "77F-LL-WYK"; */
|
||||
"77F-LL-WYK.normalTitle" = "METEO";
|
||||
|
||||
/* Class = "UILabel"; text = "Puoi essere il primo ad essere notificato quando un sisma viene rilevato. Un cliente ha sottoscritto il servizio soltanto 2 ore fa!"; ObjectID = "7EC-pz-u3s"; */
|
||||
"7EC-pz-u3s.text" = "Sé el primero en ser alertado cuando se detecta un sismo en tiempo real.";
|
||||
|
||||
/* Class = "UILabel"; text = "Label"; ObjectID = "85m-tz-xYz"; */
|
||||
"85m-tz-xYz.text" = "Label";
|
||||
|
||||
@@ -58,9 +52,6 @@
|
||||
/* Class = "UILabel"; text = "Mappa rete globale"; ObjectID = "88p-Zw-SQw"; */
|
||||
"88p-Zw-SQw.text" = "Mappa rete globale";
|
||||
|
||||
/* Class = "UILabel"; text = "Ultime 24 h:"; ObjectID = "8fS-Us-UId"; */
|
||||
"8fS-Us-UId.text" = "Últimas 24 h:";
|
||||
|
||||
/* Class = "UILabel"; text = "Dispositivo affidabile"; ObjectID = "8ix-uO-Qah"; */
|
||||
"8ix-uO-Qah.text" = "Dispositivo affidabile";
|
||||
|
||||
@@ -133,9 +124,6 @@
|
||||
/* Class = "UILabel"; text = "Label"; ObjectID = "IgH-la-uKP"; */
|
||||
"IgH-la-uKP.text" = "Label";
|
||||
|
||||
/* Class = "UILabel"; text = "Lista priorità - NUOVA!"; ObjectID = "IyW-lN-cXy"; */
|
||||
"IyW-lN-cXy.text" = "Servicio prioritario";
|
||||
|
||||
/* Class = "UILabel"; text = "Label"; ObjectID = "JAu-kk-n4H"; */
|
||||
"JAu-kk-n4H.text" = "Label";
|
||||
|
||||
@@ -181,9 +169,6 @@
|
||||
/* Class = "UILabel"; text = "Label"; ObjectID = "RPb-mG-G7i"; */
|
||||
"RPb-mG-G7i.text" = "Label";
|
||||
|
||||
/* Class = "UILabel"; text = "Versione PRO"; ObjectID = "SBb-oo-qja"; */
|
||||
"SBb-oo-qja.text" = "Versión PRO";
|
||||
|
||||
/* Class = "UIButton"; normalTitle = "Button"; ObjectID = "STa-f1-QwN"; */
|
||||
"STa-f1-QwN.normalTitle" = "Button";
|
||||
|
||||
@@ -193,9 +178,6 @@
|
||||
/* Class = "UILabel"; text = "Label"; ObjectID = "TN4-4n-dYj"; */
|
||||
"TN4-4n-dYj.text" = "Label";
|
||||
|
||||
/* Class = "UILabel"; text = "Sismi rilevati da smartphone"; ObjectID = "TdN-jP-cPf"; */
|
||||
"TdN-jP-cPf.text" = "Sismos detectados por smartphones";
|
||||
|
||||
/* Class = "UILabel"; text = "Label"; ObjectID = "Ty0-3Z-tCg"; */
|
||||
"Ty0-3Z-tCg.text" = "Label";
|
||||
|
||||
@@ -229,9 +211,6 @@
|
||||
/* Class = "UILabel"; text = "Label"; ObjectID = "WZQ-HQ-xBq"; */
|
||||
"WZQ-HQ-xBq.text" = "Label";
|
||||
|
||||
/* Class = "UILabel"; text = "smartphone sono in monitoraggio sismico"; ObjectID = "WdA-gj-Qr2"; */
|
||||
"WdA-gj-Qr2.text" = "smartphones están en monitoreo sísmico";
|
||||
|
||||
/* Class = "UIViewController"; title = "Detail"; ObjectID = "Wj9-pD-mnF"; */
|
||||
"Wj9-pD-mnF.title" = "Detail";
|
||||
|
||||
@@ -295,9 +274,6 @@
|
||||
/* Class = "UILabel"; text = "Label"; ObjectID = "f3p-2E-xJU"; */
|
||||
"f3p-2E-xJU.text" = "Label";
|
||||
|
||||
/* Class = "UILabel"; text = "Ultime 24 h:"; ObjectID = "fI2-EU-9pf"; */
|
||||
"fI2-EU-9pf.text" = "Ultime 24 h:";
|
||||
|
||||
/* Class = "UILabel"; text = "Title"; ObjectID = "fkf-ZE-eUX"; */
|
||||
"fkf-ZE-eUX.text" = "Title";
|
||||
|
||||
@@ -310,9 +286,6 @@
|
||||
/* Class = "UIButton"; normalTitle = "chiudi"; ObjectID = "g5C-Wg-DEu"; */
|
||||
"g5C-Wg-DEu.normalTitle" = "chiudi";
|
||||
|
||||
/* Class = "UILabel"; text = "Rete smartphone"; ObjectID = "gA9-1y-GkX"; */
|
||||
"gA9-1y-GkX.text" = "Red smartphone";
|
||||
|
||||
/* Class = "UIButton"; normalTitle = "Button"; ObjectID = "gH3-JA-kpZ"; */
|
||||
"gH3-JA-kpZ.normalTitle" = "Button";
|
||||
|
||||
@@ -349,9 +322,6 @@
|
||||
/* Class = "UILabel"; text = "Label"; ObjectID = "jvz-vt-Vjt"; */
|
||||
"jvz-vt-Vjt.text" = "Label";
|
||||
|
||||
/* Class = "UILabel"; text = "Converti la tua app nella versione PRO! Scopri come"; ObjectID = "jzO-Nm-azA"; */
|
||||
"jzO-Nm-azA.text" = "Convierte tu app a la versión PRO! Descubres cómo.";
|
||||
|
||||
/* Class = "UILabel"; text = "Label"; ObjectID = "k9g-Q3-Znk"; */
|
||||
"k9g-Q3-Znk.text" = "Label";
|
||||
|
||||
@@ -531,3 +501,28 @@
|
||||
"stO-8E-VwV.text" = "LEVE\n(solo percibido)";
|
||||
"yE5-wI-8FM.text" = "FUERTE\n(Caída de objetos)";
|
||||
"sqK-xD-x0a.text" = "MUY FUERTE\n(Colapso de edificios)";
|
||||
|
||||
// Controller Allerte
|
||||
"qss-8q-f70.text" = "Alertas sísmicas pasadas";
|
||||
"hbH-vC-Yma.text" = "Últimas 24h:";
|
||||
"l5q-I9-iOb.text" = "Desde el 2013:";
|
||||
"o3D-zn-NCG.normalTitle" = "MAPA 🗺";
|
||||
"Ngu-Uw-4wO.text" = "Red de smartphones";
|
||||
"dnR-12-9yN.text" = "smartphones están en monitoreo sísmico";
|
||||
"Pkb-ih-spD.normalTitle" = "COBERTURA LOCAL 🏠";
|
||||
"JeR-MS-yEq.text" = "Servicio prioritario";
|
||||
"1mF-xh-GVj.text" = "Sé el primero en ser alertado cuando se detecta un sismo en tiempo real.";
|
||||
"3dQ-Eh-0Iw.text" = "Un usuario se registró en el servicio hace solo %d minuto!";
|
||||
"Xzn-UB-fHZ.text" = "Versión PRO";
|
||||
"FKw-uA-rrj.text" = "Convierte tu app a la versión PRO! Descubres cómo.";
|
||||
"aqv-yY-TAs.text" = "Ninguna alerta en tiempo real recibida recientemente por tu smartphone";
|
||||
"BjK-4E-Vhw.normalTitle" = "PRUEBA ALERTA 🚨";
|
||||
"qkR-Lg-s4B.normalTitle" = "SIMULADOR ⏱";
|
||||
"aAC-Wz-fKA.normalTitle" = "COMO FUNCIONA 💡";
|
||||
"tml-Pn-Faa.normalTitle" = "COMPARTE APP 👨👩👦";
|
||||
"GIh-sK-KX1.text" = "La magnitud será comunicada por la red sísmica nacional y aparecerá en la sección de Redes Sísmicas de la app";
|
||||
"3Ga-UF-Cr7.normalTitle" = "CIERRA";
|
||||
"V2G-UH-Ibe.normalTitle" = "COMPARTE APP";
|
||||
"n9y-jx-2xG.normalTitle" = "VOTA LA APP";
|
||||
"Jwx-kf-che.normalTitle" = "VER EN TWITTER";
|
||||
"Kx4-f0-Dwc.normalTitle" = "CORREGIR";
|
||||
|
||||
@@ -37,18 +37,12 @@
|
||||
/* Class = "UILabel"; text = "Label"; ObjectID = "6pX-89-eYU"; */
|
||||
"6pX-89-eYU.text" = "Label";
|
||||
|
||||
/* Class = "UIButton"; normalTitle = "COPERTURA LOCALE"; ObjectID = "769-Iq-JPs"; */
|
||||
"769-Iq-JPs.normalTitle" = "COPERTURA LOCALE";
|
||||
|
||||
/* Class = "UINavigationItem"; title = "Detail"; ObjectID = "76n-gb-S2z"; */
|
||||
"76n-gb-S2z.title" = "Detail";
|
||||
|
||||
/* Class = "UIButton"; normalTitle = "METEO"; ObjectID = "77F-LL-WYK"; */
|
||||
"77F-LL-WYK.normalTitle" = "METEO";
|
||||
|
||||
/* Class = "UILabel"; text = "Puoi essere il primo ad essere notificato quando un sisma viene rilevato. Un cliente ha sottoscritto il servizio soltanto 2 ore fa!"; ObjectID = "7EC-pz-u3s"; */
|
||||
"7EC-pz-u3s.text" = "Puoi essere il primo ad essere notificato quando un sisma viene rilevato.";
|
||||
|
||||
/* Class = "UILabel"; text = "Label"; ObjectID = "85m-tz-xYz"; */
|
||||
"85m-tz-xYz.text" = "Label";
|
||||
|
||||
@@ -58,9 +52,6 @@
|
||||
/* Class = "UILabel"; text = "Mappa rete globale"; ObjectID = "88p-Zw-SQw"; */
|
||||
"88p-Zw-SQw.text" = "Mappa rete globale";
|
||||
|
||||
/* Class = "UILabel"; text = "Ultime 24 h:"; ObjectID = "8fS-Us-UId"; */
|
||||
"8fS-Us-UId.text" = "Ultime 24 h:";
|
||||
|
||||
/* Class = "UILabel"; text = "Dispositivo affidabile"; ObjectID = "8ix-uO-Qah"; */
|
||||
"8ix-uO-Qah.text" = "Dispositivo affidabile";
|
||||
|
||||
@@ -133,9 +124,6 @@
|
||||
/* Class = "UILabel"; text = "Label"; ObjectID = "IgH-la-uKP"; */
|
||||
"IgH-la-uKP.text" = "Label";
|
||||
|
||||
/* Class = "UILabel"; text = "Lista priorità - NUOVA!"; ObjectID = "IyW-lN-cXy"; */
|
||||
"IyW-lN-cXy.text" = "Servizio priorità";
|
||||
|
||||
/* Class = "UILabel"; text = "Label"; ObjectID = "JAu-kk-n4H"; */
|
||||
"JAu-kk-n4H.text" = "Label";
|
||||
|
||||
@@ -181,9 +169,6 @@
|
||||
/* Class = "UILabel"; text = "Label"; ObjectID = "RPb-mG-G7i"; */
|
||||
"RPb-mG-G7i.text" = "Label";
|
||||
|
||||
/* Class = "UILabel"; text = "Versione PRO"; ObjectID = "SBb-oo-qja"; */
|
||||
"SBb-oo-qja.text" = "Versione PRO";
|
||||
|
||||
/* Class = "UIButton"; normalTitle = "Button"; ObjectID = "STa-f1-QwN"; */
|
||||
"STa-f1-QwN.normalTitle" = "Button";
|
||||
|
||||
@@ -193,9 +178,6 @@
|
||||
/* Class = "UILabel"; text = "Label"; ObjectID = "TN4-4n-dYj"; */
|
||||
"TN4-4n-dYj.text" = "Label";
|
||||
|
||||
/* Class = "UILabel"; text = "Sismi rilevati da smartphone"; ObjectID = "TdN-jP-cPf"; */
|
||||
"TdN-jP-cPf.text" = "Sismi rilevati da smartphone";
|
||||
|
||||
/* Class = "UILabel"; text = "Label"; ObjectID = "Ty0-3Z-tCg"; */
|
||||
"Ty0-3Z-tCg.text" = "Label";
|
||||
|
||||
@@ -229,9 +211,6 @@
|
||||
/* Class = "UILabel"; text = "Label"; ObjectID = "WZQ-HQ-xBq"; */
|
||||
"WZQ-HQ-xBq.text" = "Label";
|
||||
|
||||
/* Class = "UILabel"; text = "smartphone sono in monitoraggio sismico"; ObjectID = "WdA-gj-Qr2"; */
|
||||
"WdA-gj-Qr2.text" = "smartphone sono in monitoraggio sismico";
|
||||
|
||||
/* Class = "UIViewController"; title = "Detail"; ObjectID = "Wj9-pD-mnF"; */
|
||||
"Wj9-pD-mnF.title" = "Detail";
|
||||
|
||||
@@ -295,9 +274,6 @@
|
||||
/* Class = "UILabel"; text = "Label"; ObjectID = "f3p-2E-xJU"; */
|
||||
"f3p-2E-xJU.text" = "Label";
|
||||
|
||||
/* Class = "UILabel"; text = "Ultime 24 h:"; ObjectID = "fI2-EU-9pf"; */
|
||||
"fI2-EU-9pf.text" = "Ultime 24 h:";
|
||||
|
||||
/* Class = "UILabel"; text = "Title"; ObjectID = "fkf-ZE-eUX"; */
|
||||
"fkf-ZE-eUX.text" = "Title";
|
||||
|
||||
@@ -310,9 +286,6 @@
|
||||
/* Class = "UIButton"; normalTitle = "chiudi"; ObjectID = "g5C-Wg-DEu"; */
|
||||
"g5C-Wg-DEu.normalTitle" = "chiudi";
|
||||
|
||||
/* Class = "UILabel"; text = "Rete smartphone"; ObjectID = "gA9-1y-GkX"; */
|
||||
"gA9-1y-GkX.text" = "Rete smartphone";
|
||||
|
||||
/* Class = "UIButton"; normalTitle = "Button"; ObjectID = "gH3-JA-kpZ"; */
|
||||
"gH3-JA-kpZ.normalTitle" = "Button";
|
||||
|
||||
@@ -349,9 +322,6 @@
|
||||
/* Class = "UILabel"; text = "Label"; ObjectID = "jvz-vt-Vjt"; */
|
||||
"jvz-vt-Vjt.text" = "Label";
|
||||
|
||||
/* Class = "UILabel"; text = "Converti la tua app nella versione PRO! Scopri come"; ObjectID = "jzO-Nm-azA"; */
|
||||
"jzO-Nm-azA.text" = "Converti la tua app nella versione PRO! Scopri come";
|
||||
|
||||
/* Class = "UILabel"; text = "Label"; ObjectID = "k9g-Q3-Znk"; */
|
||||
"k9g-Q3-Znk.text" = "Label";
|
||||
|
||||
@@ -531,3 +501,28 @@
|
||||
"stO-8E-VwV.text" = "LEGGERO\n(Solo percepito)";
|
||||
"yE5-wI-8FM.text" = "FORTE\n(Caduta di oggetti)";
|
||||
"sqK-xD-x0a.text" = "MOLTO FORTE\n(Crollo di edifici)";
|
||||
|
||||
// Controller Allerte
|
||||
"qss-8q-f70.text" = "Allerte sismiche passate";
|
||||
"hbH-vC-Yma.text" = "Ultime 24 h:";
|
||||
"l5q-I9-iOb.text" = "Dal 2013:";
|
||||
"o3D-zn-NCG.normalTitle" = "MAPPA 🗺";
|
||||
"Ngu-Uw-4wO.text" = "Rete smartphone";
|
||||
"dnR-12-9yN.text" = "smartphone sono in monitoraggio sismico";
|
||||
"Pkb-ih-spD.normalTitle" = "COPERTURA LOCALE 🏠";
|
||||
"JeR-MS-yEq.text" = "Servizio priorità";
|
||||
"1mF-xh-GVj.text" = "Puoi essere allertato per primo quando un sisma viene rilevato in tempo reale.";
|
||||
"3dQ-Eh-0Iw.text" = "Un utente ha sottoscritto il servizio soltanto %d minuto fa!";
|
||||
"Xzn-UB-fHZ.text" = "Versione PRO";
|
||||
"FKw-uA-rrj.text" = "Converti la tua app nella versione PRO! Scopri come";
|
||||
"aqv-yY-TAs.text" = "Nessuna allerta sismica in tempo reale ricevuta recentemente";
|
||||
"BjK-4E-Vhw.normalTitle" = "TEST ALLERTA 🚨";
|
||||
"qkR-Lg-s4B.normalTitle" = "SIMULATORE ⏱";
|
||||
"aAC-Wz-fKA.normalTitle" = "COME FUNZIONA 💡";
|
||||
"tml-Pn-Faa.normalTitle" = "CONDIVIDI APP 👨👩👦";
|
||||
"GIh-sK-KX1.text" = "La magnitudo sarà comunicata dalla rete sismica nazionale e comparirà nella sezione Reti Sismiche dell'app";
|
||||
"3Ga-UF-Cr7.normalTitle" = "CHIUDI";
|
||||
"V2G-UH-Ibe.normalTitle" = "CONDIVIDI APP";
|
||||
"n9y-jx-2xG.normalTitle" = "VOTA L'APP";
|
||||
"Jwx-kf-che.normalTitle" = "VEDI IN TWITTER";
|
||||
"Kx4-f0-Dwc.normalTitle" = "CORREGGI";
|
||||
|
||||
@@ -25,7 +25,6 @@ class EQNRoundedButton: UIButton {
|
||||
// MARK: - Private
|
||||
|
||||
private func setupUI() {
|
||||
backgroundColor = .white
|
||||
layer.masksToBounds = true
|
||||
layer.borderWidth = AppTheme.shared.borderWidth
|
||||
layer.borderColor = AppTheme.Colors.darkGray.cgColor
|
||||
|
||||
@@ -704,3 +704,18 @@
|
||||
// Segnalazioni
|
||||
"manual_sendmessage" = "Send a message that the other users can read about the earthquake that you reported";
|
||||
"manual_message_received" = "Message received";
|
||||
|
||||
// Allerte
|
||||
"youtube_video" = "https://www.youtube.com/watch?v=BqaW97fJFZc";
|
||||
"inapp_adv" = "A user has subscribed to the service only %@!";
|
||||
"map_number" = "Quake detected by %@ smartphones";
|
||||
"permission_location_no" = "You have chosen to prevent the app from reading the location of the device. You will NOT receive real-time notifications and alerts";
|
||||
"permission_location_no_background" = "You have chosen to prevent the app from reading the location of your device when the app is in the background. Notifications and real time alerts may NOT be received";
|
||||
|
||||
// Varie
|
||||
"minutes_one" = "%lu minute ago";
|
||||
"minutes_other" = "%lu minutes ago";
|
||||
"hours_one" = "%lu hour ago";
|
||||
"hours_other" = "%lu hours ago";
|
||||
"days_one" = "%lu day ago";
|
||||
"days_other" = "%lu days ago";
|
||||
|
||||
@@ -699,3 +699,18 @@
|
||||
// Segnalazioni
|
||||
"manual_sendmessage" = "Enviar un mensaje que los demás usuarios puedan leer sobre el sismo que has notificado";
|
||||
"manual_message_received" = "Mensaje recibido";
|
||||
|
||||
// Allerte
|
||||
"youtube_video" = "https://www.youtube.com/watch?v=etsF7arwVdg";
|
||||
"inapp_adv" = "Un usuario se registró en el servicio hace solo %@!";
|
||||
"map_number" = "Sismo detectado por %@ smartphones";
|
||||
"permission_location_no" = "Ha elegido evitar que la aplicación lea la ubicación de tu dispositivo. NO recibirá notificaciones y alertas en tiempo real";
|
||||
"permission_location_no_background" = "Ha elegido evitar que la aplicación lea la ubicación de tu dispositivo cuando la aplicación está en segundo plano. Por lo tanto, NO se garantiza la recepción de notificaciones y alertas en tiempo real";
|
||||
|
||||
// Varie
|
||||
"minutes_one" = "%lu minuto";
|
||||
"minutes_other" = "%lu minutos";
|
||||
"hours_one" = "%lu hora";
|
||||
"hours_other" = "%lu horas";
|
||||
"days_one" = "%lu día";
|
||||
"days_other" = "%lu días";
|
||||
|
||||
@@ -692,3 +692,18 @@
|
||||
// Segnalazioni
|
||||
"manual_sendmessage" = "Invia un messaggio che gli altri utenti possono leggere sul sisma che hai segnalato";
|
||||
"manual_message_received" = "Messaggio ricevuto";
|
||||
|
||||
// Allerte
|
||||
"youtube_video" = "https://www.youtube.com/watch?v=ExvvPyEJglQ&t=1s";
|
||||
"inapp_adv" = "Un utente ha sottoscritto il servizio soltanto %@!";
|
||||
"map_number" = "Sisma rilevato da %@ smartphone";
|
||||
"permission_location_no" = "Hai scelto di impedire alla app di leggere la posizione del tuo dispositivo. NON riceverai notifiche ed allerte in tempo reale.";
|
||||
"permission_location_no_background" = "Hai scelto di impedire alla app di leggere la posizione del tuo dispositivo quando la app è in background. NON è quindi garantita la ricezione di notifiche ed allerte in tempo reale.";
|
||||
|
||||
// Varie
|
||||
"minutes_one" = "%lu minuto fa";
|
||||
"minutes_other" = "%lu minuti fa";
|
||||
"hours_one" = "%lu ora fa";
|
||||
"hours_other" = "%lu ore fa";
|
||||
"days_one" = "%lu giorno fa";
|
||||
"days_other" = "%lu giorni fa";
|
||||
|
||||
@@ -73,6 +73,8 @@
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:EQNNotificationDidChangeAuthorizationStatus object:nil userInfo:@{}];
|
||||
}
|
||||
|
||||
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface EQNReteSmartphone : NSObject
|
||||
|
||||
@property (nonatomic, strong) NSString *eq;
|
||||
@@ -19,6 +21,8 @@
|
||||
@property (nonatomic, strong) NSString *diff;
|
||||
@property (nonatomic) BOOL subscriptionsDiscounted;
|
||||
|
||||
-(id)initWithInfo:(NSArray *)list;
|
||||
- (instancetype)initWithInfo:(NSArray *)list;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -10,9 +10,12 @@
|
||||
|
||||
@implementation EQNReteSmartphone
|
||||
|
||||
-(id)initWithInfo:(NSArray *)list{
|
||||
#pragma mark - Init
|
||||
|
||||
- (instancetype)initWithInfo:(NSArray *)list
|
||||
{
|
||||
self = [super init];
|
||||
if(self != nil) {
|
||||
if (self) {
|
||||
for ( int i = 0; i < list.count; i++) {
|
||||
NSDictionary *dict = list[i];
|
||||
switch (i) {
|
||||
@@ -45,12 +48,13 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)encodeWithCoder:(NSCoder *)encoder {
|
||||
//Encode properties, other class variables, etc
|
||||
#pragma mark - NSCoding
|
||||
|
||||
- (void)encodeWithCoder:(NSCoder *)encoder
|
||||
{
|
||||
[encoder encodeObject:self.eq forKey:@"eq"];
|
||||
[encoder encodeObject:self.eq_p forKey:@"eq_p"];
|
||||
[encoder encodeObject:self.green forKey:@"green"];
|
||||
@@ -58,12 +62,12 @@
|
||||
[encoder encodeObject:self.y_man forKey:@"y_man"];
|
||||
[encoder encodeObject:self.r_man forKey:@"r_man"];
|
||||
[encoder encodeObject:self.diff forKey:@"diff"];
|
||||
|
||||
}
|
||||
|
||||
- (id)initWithCoder:(NSCoder *)decoder {
|
||||
if((self = [super init])) {
|
||||
//decode properties, other class vars
|
||||
- (instancetype)initWithCoder:(NSCoder *)decoder
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.eq = [decoder decodeObjectForKey:@"eq"];
|
||||
self.eq_p = [decoder decodeObjectForKey:@"eq_p"];
|
||||
self.green = [decoder decodeObjectForKey:@"green"];
|
||||
@@ -71,7 +75,6 @@
|
||||
self.y_man = [decoder decodeObjectForKey:@"y_man"];
|
||||
self.r_man = [decoder decodeObjectForKey:@"r_man"];
|
||||
self.diff = [decoder decodeObjectForKey:@"diff"];
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
+(NSDictionary *)readDictyWithCustomObjFromUserDefaults:(NSString*)keyName;
|
||||
+(NSString *)clearStringMessaggi:(NSString *)messaggio;
|
||||
+(NSInteger )getDifferenceMinute:(NSDate *)date;
|
||||
+(UIViewController *)shareFileWithPath:(id)path;
|
||||
|
||||
|
||||
/// Creates Ad-sense banner to show on a given controller
|
||||
|
||||
@@ -201,15 +201,6 @@
|
||||
[[bannerAnchor constraintEqualToAnchor:parentAnchor] setActive:YES];
|
||||
}
|
||||
|
||||
+(UIViewController *)shareFileWithPath:(id )path{
|
||||
|
||||
NSArray* dataToShare = @[path];
|
||||
UIActivityViewController* activityViewController =[[UIActivityViewController alloc] initWithActivityItems:dataToShare applicationActivities:nil];
|
||||
activityViewController.excludedActivityTypes = @[UIActivityTypeAirDrop];
|
||||
|
||||
return activityViewController;
|
||||
}
|
||||
|
||||
#pragma mark - Store/load data
|
||||
|
||||
+ (void)storeArray:(NSArray *)array toUserDefaultForKey:(NSString *)keyName
|
||||
|
||||
Reference in New Issue
Block a user