Compare commits

...

15 Commits

Author SHA1 Message Date
Andrea Busi a871f7b27b release: Increase version for release 2020-09-23 10:28:34 +02:00
Andrea Busi b88a1e197f fix: Solve issue when saving real time alert notification setting 2020-09-23 10:23:54 +02:00
Andrea Busi d4986ac610 refactor: Improve EQNAllertaSismica code 2020-09-23 10:21:41 +02:00
Andrea Busi 4a77692e23 release: Update version for release 2020-09-02 22:51:38 +02:00
Andrea Busi d6b6d6883f refactor: Remove distanza sismi vicini setting and change label
Resolves: https://gitlab.steamware.net/eqn/eqn.ios/-/issues/11
2020-09-02 22:51:38 +02:00
Andrea Busi 5528756aad refactor: Change label for raggio sismi forti setting
Resolves: https://gitlab.steamware.net/eqn/eqn.ios/-/issues/11
2020-09-02 22:51:38 +02:00
Andrea Busi 1970cc21ec refactor: Remove sismi senza intensità setting
Resolves: https://gitlab.steamware.net/eqn/eqn.ios/-/issues/11
2020-09-02 22:51:38 +02:00
Andrea Busi bb54e78278 fix: Add missing case for new tab item 2020-09-02 22:51:38 +02:00
Andrea Busi 5cef7215df chore: Remove unused files from Git folder 2020-09-01 19:27:54 +02:00
Andrea Busi ffa63352b2 refactor: Remove unused CoreData initialization 2020-09-01 19:27:54 +02:00
Andrea Busi c6ee123eee refactor: Add class to share a theme across the app 2020-09-01 19:27:54 +02:00
Andrea Busi e9846cc75d refactor: Remove no longer user menu and SWRevealViewController 2020-09-01 19:27:54 +02:00
Andrea Busi 1792f4b4bb refactor: Move settings as tab section
- Rewrite Settings controller in Swift
- Move settings as tab bar item
- Force settings save when user change tab or back from a sub-setting controller
2020-09-01 19:27:54 +02:00
Andrea Busi 7e7747efcb Refactor: Update strings for 'Always allow' location permission
Resolves: https://gitlab.steamware.net/eqn/eqn.ios/-/issues/13
2020-09-01 19:26:19 +02:00
Andrea Busi 0d5bf272c1 refactor: Update app icon
Resolves: https://gitlab.steamware.net/eqn/eqn.ios/-/issues/9
2020-09-01 19:26:19 +02:00
73 changed files with 405 additions and 6761 deletions
+17
View File
@@ -1,5 +1,22 @@
# Changelog
## Versione 2.2.1
### Build (24)
- Corretto problema in salvataggio impostazione allerte in tempo reale
## Versione 2.2
### Build (19)
- Semplificate alcune voci nel menu Impostazioni
### Build (18)
- Impostazioni occupa ora un tab di navigazione
- Rimosso menu laterale e spostati link in sezione Impostazioni
- Rimossi riferimenti a CoraData inutilizzati
- Aggiornata icona app
- Aggiornati messaggi per permesso localizzatione (stato Consenti Sempre)
## Versione 2.1
### Build (17)
@@ -52,7 +52,6 @@
8C7CD64821F7D0F800835812 /* ReteSismicaAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CD08637218B3BEE0000CB5E /* ReteSismicaAnnotation.m */; };
8C7CD64921F7D11700835812 /* ReteSismicaAnnotation.m in Frameworks */ = {isa = PBXBuildFile; fileRef = 8CD08637218B3BEE0000CB5E /* ReteSismicaAnnotation.m */; };
8C7CD64A21F7D11700835812 /* ReteSismicaAnnotation.h in Frameworks */ = {isa = PBXBuildFile; fileRef = 8CD08636218B3BEE0000CB5E /* ReteSismicaAnnotation.h */; };
8C7E945A21E548A600B0B770 /* SettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C7E945921E548A600B0B770 /* SettingsViewController.m */; };
8C8EBBA721540039002784BA /* EQNUser.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C8EBBA621540039002784BA /* EQNUser.m */; };
8C9B755C2233A25100F8FDEE /* MenuFiltroEntiViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C9B755B2233A25100F8FDEE /* MenuFiltroEntiViewController.m */; };
8C9B755F2233BFDE00F8FDEE /* FiltroEnti.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C9B755E2233BFDE00F8FDEE /* FiltroEnti.m */; };
@@ -64,7 +63,6 @@
8CBD3DC72149B9AD0070C963 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CBD3DC62149B9AD0070C963 /* AppDelegate.m */; };
8CBD3DCA2149B9AD0070C963 /* ReteSmartphone.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CBD3DC92149B9AD0070C963 /* ReteSmartphone.m */; };
8CBD3DCD2149B9AD0070C963 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8CBD3DCB2149B9AD0070C963 /* Main.storyboard */; };
8CBD3DD02149B9AD0070C963 /* Earthquake_Network.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 8CBD3DCE2149B9AD0070C963 /* Earthquake_Network.xcdatamodeld */; };
8CBD3DD22149B9AD0070C963 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8CBD3DD12149B9AD0070C963 /* Assets.xcassets */; };
8CBD3DD52149B9AD0070C963 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8CBD3DD32149B9AD0070C963 /* LaunchScreen.storyboard */; };
8CBD3DD82149B9AD0070C963 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CBD3DD72149B9AD0070C963 /* main.m */; };
@@ -81,7 +79,6 @@
8CD08631218ADFCA0000CB5E /* Cell_Reti_sismicheTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CD08630218ADFCA0000CB5E /* Cell_Reti_sismicheTableViewCell.m */; };
8CD08635218AF6030000CB5E /* Cell_Meteo_TableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CD08634218AF6030000CB5E /* Cell_Meteo_TableViewCell.m */; };
8CD08638218B3BEE0000CB5E /* ReteSismicaAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CD08637218B3BEE0000CB5E /* ReteSismicaAnnotation.m */; };
8CEAE4D92163E23E001A42B9 /* SWRevealViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CEAE4D82163E23D001A42B9 /* SWRevealViewController.m */; };
8CF05B51218C41FB0055012B /* PickerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CF05B4B218C41F90055012B /* PickerViewController.m */; };
8CF05B52218C41FB0055012B /* TBDInputViewControllerData.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8CF05B4E218C41FA0055012B /* TBDInputViewControllerData.xib */; };
8CF05B53218C41FB0055012B /* PickerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8CF05B4F218C41FA0055012B /* PickerViewController.xib */; };
@@ -111,14 +108,14 @@
DC27EB2F24F6EBE000ACBFE0 /* SettingsSeismicNetworksViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC27EB2E24F6EBE000ACBFE0 /* SettingsSeismicNetworksViewController.swift */; };
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 */; };
DC52B8A224FC145500ABEBA6 /* SettingsBaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DC52B8A124FC145500ABEBA6 /* SettingsBaseViewController.m */; };
DC52B8A524FCCD6900ABEBA6 /* AppTheme.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC52B8A424FCCD6900ABEBA6 /* AppTheme.swift */; };
DC886A5D24E92D5500F7A5D3 /* EQNBaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DC886A5C24E92D5500F7A5D3 /* EQNBaseViewController.m */; };
DC99A50324E66E270071BC9F /* EQNCommandProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC99A50224E66E270071BC9F /* EQNCommandProtocol.swift */; };
DC99A50524E66E430071BC9F /* EQNAppearanceCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC99A50424E66E430071BC9F /* EQNAppearanceCommand.swift */; };
DC99A50724E66E5F0071BC9F /* EQNStartupCommandsBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC99A50624E66E5F0071BC9F /* EQNStartupCommandsBuilder.swift */; };
DCAA913F24F68A1D00145A3D /* SettingMultivaluesTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCAA913E24F68A1D00145A3D /* SettingMultivaluesTableViewCell.swift */; };
DCAB01E324CEBFE800E8B54C /* MenuViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCAB01E224CEBFE800E8B54C /* MenuViewController.swift */; };
DCAB01E524CEC12E00E8B54C /* MenuHeaderTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCAB01E424CEC12E00E8B54C /* MenuHeaderTableViewCell.swift */; };
DCAB01E724CEC22100E8B54C /* MenuItemTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCAB01E624CEC22100E8B54C /* MenuItemTableViewCell.swift */; };
DCB28CEE24FB8400001F557E /* SettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCB28CED24FB8400001F557E /* SettingsViewController.swift */; };
DCB6FBEC24D0B40600ED23B8 /* Colors.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DCB6FBEB24D0B40600ED23B8 /* Colors.xcassets */; };
DCBB267A24D1E7F500F04559 /* SubscriptionsHeaderTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCBB267924D1E7F500F04559 /* SubscriptionsHeaderTableViewCell.swift */; };
DCBB267C24D1E98300F04559 /* EQNBaseTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCBB267B24D1E98300F04559 /* EQNBaseTableViewCell.swift */; };
@@ -232,8 +229,6 @@
8C6CBAE421597E79005C426A /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
8C7A3B64225A5EA30045B266 /* NSDictionary+BVJSONString.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+BVJSONString.m"; sourceTree = "<group>"; };
8C7A3B65225A5EA40045B266 /* NSDictionary+BVJSONString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+BVJSONString.h"; sourceTree = "<group>"; };
8C7E945821E548A600B0B770 /* SettingsViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SettingsViewController.h; sourceTree = "<group>"; };
8C7E945921E548A600B0B770 /* SettingsViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SettingsViewController.m; sourceTree = "<group>"; };
8C8EBBA521540039002784BA /* EQNUser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EQNUser.h; sourceTree = "<group>"; };
8C8EBBA621540039002784BA /* EQNUser.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EQNUser.m; sourceTree = "<group>"; };
8C9B755A2233A25100F8FDEE /* MenuFiltroEntiViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MenuFiltroEntiViewController.h; sourceTree = "<group>"; };
@@ -256,7 +251,6 @@
8CBD3DC82149B9AD0070C963 /* ReteSmartphone.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ReteSmartphone.h; sourceTree = "<group>"; };
8CBD3DC92149B9AD0070C963 /* ReteSmartphone.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ReteSmartphone.m; sourceTree = "<group>"; };
8CBD3DCC2149B9AD0070C963 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
8CBD3DCF2149B9AD0070C963 /* Earthquake_Network.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Earthquake_Network.xcdatamodel; sourceTree = "<group>"; };
8CBD3DD12149B9AD0070C963 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
8CBD3DD42149B9AD0070C963 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
8CBD3DD72149B9AD0070C963 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
@@ -286,8 +280,6 @@
8CD08634218AF6030000CB5E /* Cell_Meteo_TableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Cell_Meteo_TableViewCell.m; sourceTree = "<group>"; };
8CD08636218B3BEE0000CB5E /* ReteSismicaAnnotation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ReteSismicaAnnotation.h; sourceTree = "<group>"; };
8CD08637218B3BEE0000CB5E /* ReteSismicaAnnotation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ReteSismicaAnnotation.m; sourceTree = "<group>"; };
8CEAE4D72163E23D001A42B9 /* SWRevealViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWRevealViewController.h; sourceTree = "<group>"; };
8CEAE4D82163E23D001A42B9 /* SWRevealViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWRevealViewController.m; sourceTree = "<group>"; };
8CF05B4B218C41F90055012B /* PickerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PickerViewController.m; sourceTree = "<group>"; };
8CF05B4C218C41F90055012B /* TBDInputViewControllerData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TBDInputViewControllerData.h; sourceTree = "<group>"; };
8CF05B4D218C41FA0055012B /* PickerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PickerViewController.h; sourceTree = "<group>"; };
@@ -333,15 +325,16 @@
DC27EB2E24F6EBE000ACBFE0 /* SettingsSeismicNetworksViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsSeismicNetworksViewController.swift; sourceTree = "<group>"; };
DC3BA11024D1A9C90062EE7F /* SubscriptionsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionsViewController.swift; sourceTree = "<group>"; };
DC414C0024CDA09A008D9AE4 /* CHANGELOG.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = CHANGELOG.md; path = ../CHANGELOG.md; 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>"; };
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>"; };
DC99A50224E66E270071BC9F /* EQNCommandProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EQNCommandProtocol.swift; sourceTree = "<group>"; };
DC99A50424E66E430071BC9F /* EQNAppearanceCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EQNAppearanceCommand.swift; sourceTree = "<group>"; };
DC99A50624E66E5F0071BC9F /* EQNStartupCommandsBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EQNStartupCommandsBuilder.swift; sourceTree = "<group>"; };
DCAA913E24F68A1D00145A3D /* SettingMultivaluesTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingMultivaluesTableViewCell.swift; sourceTree = "<group>"; };
DCAB01E224CEBFE800E8B54C /* MenuViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuViewController.swift; sourceTree = "<group>"; };
DCAB01E424CEC12E00E8B54C /* MenuHeaderTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuHeaderTableViewCell.swift; sourceTree = "<group>"; };
DCAB01E624CEC22100E8B54C /* MenuItemTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuItemTableViewCell.swift; sourceTree = "<group>"; };
DCB28CED24FB8400001F557E /* SettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsViewController.swift; sourceTree = "<group>"; };
DCB6FBEB24D0B40600ED23B8 /* Colors.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Colors.xcassets; sourceTree = "<group>"; };
DCBB267924D1E7F500F04559 /* SubscriptionsHeaderTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionsHeaderTableViewCell.swift; sourceTree = "<group>"; };
DCBB267B24D1E98300F04559 /* EQNBaseTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EQNBaseTableViewCell.swift; sourceTree = "<group>"; };
@@ -428,8 +421,6 @@
8C602247218D9DBF00C799C2 /* Dettagli mappa */,
8CF05B4A218C41E60055012B /* inputView */,
8CD08632218AF5C80000CB5E /* cellTableView */,
8CEAE4D72163E23D001A42B9 /* SWRevealViewController.h */,
8CEAE4D82163E23D001A42B9 /* SWRevealViewController.m */,
8CBD3DC82149B9AD0070C963 /* ReteSmartphone.h */,
8CBD3DC92149B9AD0070C963 /* ReteSmartphone.m */,
8CF4F4DC2175352E0057110B /* WaitViewController.h */,
@@ -514,7 +505,6 @@
8CBD3DC52149B9AD0070C963 /* AppDelegate.h */,
8CBD3DC62149B9AD0070C963 /* AppDelegate.m */,
8C483CB021FDA8C700259FD2 /* Earthquake Network-Bridging-Header.h */,
8CBD3DCE2149B9AD0070C963 /* Earthquake_Network.xcdatamodeld */,
DCB6FBEA24D0B11300ED23B8 /* Controllers */,
DCB6FBE924D0B0DF00ED23B8 /* Models */,
DCC23DED24D28F41003A2404 /* UI */,
@@ -719,16 +709,6 @@
path = Commands;
sourceTree = "<group>";
};
DCAB01E124CEBFD500E8B54C /* Menu */ = {
isa = PBXGroup;
children = (
DCAB01E224CEBFE800E8B54C /* MenuViewController.swift */,
DCAB01E424CEC12E00E8B54C /* MenuHeaderTableViewCell.swift */,
DCAB01E624CEC22100E8B54C /* MenuItemTableViewCell.swift */,
);
path = Menu;
sourceTree = "<group>";
};
DCB6FBE924D0B0DF00ED23B8 /* Models */ = {
isa = PBXGroup;
children = (
@@ -754,7 +734,6 @@
DC886A5B24E92D5500F7A5D3 /* EQNBaseViewController.h */,
DC886A5C24E92D5500F7A5D3 /* EQNBaseViewController.m */,
DCD3E3BE24D1555F007C78D4 /* InApp */,
DCAB01E124CEBFD500E8B54C /* Menu */,
DCEFF21024F57163009D3FE1 /* Settings */,
);
path = Controllers;
@@ -764,6 +743,7 @@
isa = PBXGroup;
children = (
DCC23DEE24D28F58003A2404 /* EQNEdgeInsetLabel.swift */,
DC52B8A424FCCD6900ABEBA6 /* AppTheme.swift */,
);
path = UI;
sourceTree = "<group>";
@@ -786,8 +766,9 @@
isa = PBXGroup;
children = (
DCEFF21124F581F9009D3FE1 /* Cells */,
8C7E945821E548A600B0B770 /* SettingsViewController.h */,
8C7E945921E548A600B0B770 /* SettingsViewController.m */,
DCB28CED24FB8400001F557E /* SettingsViewController.swift */,
DC52B8A024FC145500ABEBA6 /* SettingsBaseViewController.h */,
DC52B8A124FC145500ABEBA6 /* SettingsBaseViewController.m */,
8CCE165321EA378800173CD9 /* SettingsUserReportAlertsViewController.h */,
8CCE165421EA378800173CD9 /* SettingsUserReportAlertsViewController.m */,
8CCE165621EB1E0000173CD9 /* SettingsSeismicNetworkAlertsViewController.h */,
@@ -1101,9 +1082,9 @@
8CF05B54218C41FB0055012B /* TBDInputViewControllerData.m in Sources */,
8CCE166121EBA37500173CD9 /* EQNNotificheTsunami.m in Sources */,
DCC23DEF24D28F58003A2404 /* EQNEdgeInsetLabel.swift in Sources */,
DCAB01E524CEC12E00E8B54C /* MenuHeaderTableViewCell.swift in Sources */,
8CCE165121E7BAEC00173CD9 /* EQNNotificeReteSismiche.m in Sources */,
8C13E84B220B2E7E0009CFE4 /* MenuSelezioneEntiViewController.m in Sources */,
DC52B8A224FC145500ABEBA6 /* SettingsBaseViewController.m in Sources */,
8CF4F4DB216D44930057110B /* EQNPastquakes.m in Sources */,
8CCE165821EB1E0000173CD9 /* SettingsSeismicNetworkAlertsViewController.m in Sources */,
8CCE165521EA378800173CD9 /* SettingsUserReportAlertsViewController.m in Sources */,
@@ -1114,7 +1095,6 @@
8CCE164E21E7BACE00173CD9 /* EQNNotificheSegnalazioniUtente.m in Sources */,
DCD4571C24F6CF0D00B58304 /* EQNGenericValue.swift in Sources */,
8C4E343F215012FA008B0D2A /* EQNManager.m in Sources */,
8C7E945A21E548A600B0B770 /* SettingsViewController.m in Sources */,
8CABD7212194B7C700C3E09C /* ImpostazioniViewController.m in Sources */,
DCAA913F24F68A1D00145A3D /* SettingMultivaluesTableViewCell.swift in Sources */,
DCF9E14F24F6EA07002B6B1D /* EQNSeismicNetwork.swift in Sources */,
@@ -1129,11 +1109,10 @@
8CF66058214C566B009F4314 /* ServerRequest.m in Sources */,
8CD08638218B3BEE0000CB5E /* ReteSismicaAnnotation.m in Sources */,
8CD0862E218A41930000CB5E /* CellDettagliMappaTableViewCell.m in Sources */,
8CBD3DD02149B9AD0070C963 /* Earthquake_Network.xcdatamodeld in Sources */,
DCF9E14D24F6D1AA002B6B1D /* EQNData.swift in Sources */,
8C9B755F2233BFDE00F8FDEE /* FiltroEnti.m in Sources */,
DC52B8A524FCCD6900ABEBA6 /* AppTheme.swift in Sources */,
DC27EB2F24F6EBE000ACBFE0 /* SettingsSeismicNetworksViewController.swift in Sources */,
DCAB01E724CEC22100E8B54C /* MenuItemTableViewCell.swift in Sources */,
8CF66059214C566B009F4314 /* Reachability.m in Sources */,
DC886A5D24E92D5500F7A5D3 /* EQNBaseViewController.m in Sources */,
8C593E8A217BA2470008B260 /* EQNSegnalazione.m in Sources */,
@@ -1159,7 +1138,6 @@
8C14113121ED3E5B00A59729 /* SettingsRealTimeAlertsViewController.m in Sources */,
8CCE164B21E7BAB200173CD9 /* EQNNotificheTempoReale.m in Sources */,
DCBB267A24D1E7F500F04559 /* SubscriptionsHeaderTableViewCell.swift in Sources */,
8CEAE4D92163E23E001A42B9 /* SWRevealViewController.m in Sources */,
8CF4F4D2216D2C780057110B /* EQNReteSmartphone.m in Sources */,
DC08804124F5B41400186D97 /* SettingSliderTableViewCell.swift in Sources */,
8CBD3DD82149B9AD0070C963 /* main.m in Sources */,
@@ -1176,10 +1154,10 @@
8C9B755C2233A25100F8FDEE /* MenuFiltroEntiViewController.m in Sources */,
8CBD3DC72149B9AD0070C963 /* AppDelegate.m in Sources */,
8CA46BA12194532E00C63C16 /* SismaAnnotation.m in Sources */,
DCB28CEE24FB8400001F557E /* SettingsViewController.swift in Sources */,
8C602246218D9DB200C799C2 /* PastquakesDettagliMappa.m in Sources */,
8CAFD7C82182648600F8BD29 /* EQNRetiSismiViewController.m in Sources */,
DCEFF21A24F587E3009D3FE1 /* SettingItem.swift in Sources */,
DCAB01E324CEBFE800E8B54C /* MenuViewController.swift in Sources */,
8C8EBBA721540039002784BA /* EQNUser.m in Sources */,
8CADAA9421B2627D0044E256 /* LogViewController.m in Sources */,
DC11ABE824E6700E00D866A8 /* UIColor+EQN.swift in Sources */,
@@ -1272,12 +1250,12 @@
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 17;
CURRENT_PROJECT_VERSION = 24;
DEVELOPMENT_TEAM = WJA4MR4CPC;
INFOPLIST_FILE = EQNNotificationService/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
MARKETING_VERSION = 2.1;
MARKETING_VERSION = 2.2.1;
PRODUCT_BUNDLE_IDENTIFIER = com.finazzi.distquake.EQNNotificationService;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "Earthquake Network Extensions - Development";
@@ -1294,12 +1272,12 @@
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 17;
CURRENT_PROJECT_VERSION = 24;
DEVELOPMENT_TEAM = WJA4MR4CPC;
INFOPLIST_FILE = EQNNotificationService/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
MARKETING_VERSION = 2.1;
MARKETING_VERSION = 2.2.1;
PRODUCT_BUNDLE_IDENTIFIER = com.finazzi.distquake.EQNNotificationService;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "Earthquake Network Extensions - Development";
@@ -1430,14 +1408,14 @@
CODE_SIGN_ENTITLEMENTS = "Earthquake Network/Earthquake Network.entitlements";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 17;
CURRENT_PROJECT_VERSION = 24;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = WJA4MR4CPC;
GCC_PREFIX_HEADER = "Earthquake Network/Earthquake Network-Prefix.pch";
INFOPLIST_FILE = "Earthquake Network/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 2.1;
MARKETING_VERSION = 2.2.1;
PRODUCT_BUNDLE_IDENTIFIER = com.finazzi.distquake;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
@@ -1458,13 +1436,13 @@
CODE_SIGN_ENTITLEMENTS = "Earthquake Network/Earthquake Network.entitlements";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 17;
CURRENT_PROJECT_VERSION = 24;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = WJA4MR4CPC;
GCC_PREFIX_HEADER = "Earthquake Network/Earthquake Network-Prefix.pch";
INFOPLIST_FILE = "Earthquake Network/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 2.1;
MARKETING_VERSION = 2.2.1;
PRODUCT_BUNDLE_IDENTIFIER = com.finazzi.distquake;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
@@ -1480,12 +1458,12 @@
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 17;
CURRENT_PROJECT_VERSION = 24;
DEVELOPMENT_TEAM = WJA4MR4CPC;
INFOPLIST_FILE = EQNNotificationContent/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
MARKETING_VERSION = 2.1;
MARKETING_VERSION = 2.2.1;
PRODUCT_BUNDLE_IDENTIFIER = com.finazzi.distquake.EQNNotificationContent;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "Earthquake Network Extensions - Development";
@@ -1502,12 +1480,12 @@
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 17;
CURRENT_PROJECT_VERSION = 24;
DEVELOPMENT_TEAM = WJA4MR4CPC;
INFOPLIST_FILE = EQNNotificationContent/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
MARKETING_VERSION = 2.1;
MARKETING_VERSION = 2.2.1;
PRODUCT_BUNDLE_IDENTIFIER = com.finazzi.distquake.EQNNotificationContent;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "Earthquake Network Extensions - Development";
@@ -1558,19 +1536,6 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
/* Begin XCVersionGroup section */
8CBD3DCE2149B9AD0070C963 /* Earthquake_Network.xcdatamodeld */ = {
isa = XCVersionGroup;
children = (
8CBD3DCF2149B9AD0070C963 /* Earthquake_Network.xcdatamodel */,
);
currentVersion = 8CBD3DCF2149B9AD0070C963 /* Earthquake_Network.xcdatamodel */;
path = Earthquake_Network.xcdatamodeld;
sourceTree = "<group>";
versionGroupType = wrapper.xcdatamodel;
};
/* End XCVersionGroup section */
};
rootObject = 8CBD3DBA2149B9AD0070C963 /* Project object */;
}
@@ -1,34 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Termogea.ipa</key>
<array>
<dict>
<key>architectures</key>
<array>
<string>armv7</string>
<string>arm64</string>
</array>
<key>certificate</key>
<dict>
<key>SHA1</key>
<string></string>
<key>dateExpires</key>
<string></string>
<key>type</key>
<string>Unknown</string>
</dict>
<key>name</key>
<string>Telegea.app</string>
<key>team</key>
<dict>
<key>id</key>
<string>4E74YD2Y2V</string>
<key>name</key>
<string>DEK Italia S.R.L</string>
</dict>
</dict>
</array>
</dict>
</plist>
@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>compileBitcode</key>
<true/>
<key>destination</key>
<string>export</string>
<key>method</key>
<string>ad-hoc</string>
<key>signingStyle</key>
<string>automatic</string>
<key>stripSwiftSymbols</key>
<true/>
<key>teamID</key>
<string>4E74YD2Y2V</string>
<key>thinning</key>
<string>&lt;none&gt;</string>
</dict>
</plist>
File diff suppressed because it is too large Load Diff
-5
View File
@@ -7,7 +7,6 @@
//
#import <UIKit/UIKit.h>
#import <CoreData/CoreData.h>
@class EQNMainTabBarController;
@class ReteSmartphone;
@@ -17,10 +16,6 @@
@property (strong, nonatomic) UIWindow *window;
@property (weak, nonatomic) EQNMainTabBarController *mainTabBarController;
@property (weak, nonatomic) ReteSmartphone *reteSmartphone;
@property (readonly, strong) NSPersistentContainer *persistentContainer;
- (void)saveContext;
@end
+1 -49
View File
@@ -102,7 +102,6 @@
- (void)applicationWillTerminate:(UIApplication *)application {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
// Saves changes in the application's managed object context before the application terminates.
[self saveContext];
}
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
@@ -207,52 +206,7 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
}
#pragma mark - Core Data stack
@synthesize persistentContainer = _persistentContainer;
- (NSPersistentContainer *)persistentContainer {
// The persistent container for the application. This implementation creates and returns a container, having loaded the store for the application to it.
@synchronized (self) {
if (_persistentContainer == nil) {
_persistentContainer = [[NSPersistentContainer alloc] initWithName:@"Earthquake_Network"];
[_persistentContainer loadPersistentStoresWithCompletionHandler:^(NSPersistentStoreDescription *storeDescription, NSError *error) {
if (error != nil) {
// Replace this implementation with code to handle the error appropriately.
// abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
/*
Typical reasons for an error here include:
* The parent directory does not exist, cannot be created, or disallows writing.
* The persistent store is not accessible, due to permissions or data protection when the device is locked.
* The device is out of space.
* The store could not be migrated to the current model version.
Check the error message to determine what the actual problem was.
*/
NSLog(@"Unresolved error %@, %@", error, error.userInfo);
abort();
}
}];
}
}
return _persistentContainer;
}
#pragma mark - Core Data Saving support
- (void)saveContext {
NSManagedObjectContext *context = self.persistentContainer.viewContext;
NSError *error = nil;
if ([context hasChanges] && ![context save:&error]) {
// Replace this implementation with code to handle the error appropriately.
// abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
NSLog(@"Unresolved error %@, %@", error, error.userInfo);
abort();
}
}
#pragma mark - FIRMessagingDelegate
- (void)messaging:(FIRMessaging *)messaging didReceiveRegistrationToken:(NSString *)fcmToken {
@@ -267,7 +221,6 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
[EQNAllertaSismica center].raggioSismiLievi = @"300";
[EQNAllertaSismica center].raggioSismiForti = @"600";
[EQNAllertaSismica center].sismiDaNotificare = @"0";
[EQNAllertaSismica center].isSimiSenzaIntensita = YES;;
[[EQNAllertaSismica center] saveUserInfo];
[EQNNotificheSegnalazioniUtente center].isAbilitato = YES;
@@ -276,7 +229,6 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
[EQNNotificeReteSismiche center].isAbilitato = YES;
[EQNNotificeReteSismiche center].distanzaPosizione = @"1000";
[EQNNotificeReteSismiche center].distanzaVicini = @"100";
[EQNNotificeReteSismiche center].isAbilitaVicini = NO;
[EQNNotificeReteSismiche center].energiaSisma = @"3.5";
[EQNNotificeReteSismiche center].energiaTerremotiForti = @"7.5";
@@ -14,7 +14,8 @@ NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger, EQNTabBarSection) {
EQNTabBarSectionAllerte = 0,
EQNTabBarSectionSegnalazioni,
EQNTabBarSectionRetiSismiche
EQNTabBarSectionRetiSismiche,
EQNTabBarSectionImpostazioni
};
@interface EQNMainTabBarController : UITabBarController
@@ -8,7 +8,6 @@
#import "EQNMainTabBarController.h"
#import "AppDelegate.h"
#import "SWRevealViewController.h"
#import "EQNBaseViewController.h"
#import "EQNUtility.h"
@@ -49,51 +48,13 @@ static NSString * const SegueIdentifierLogs = @"ShowLogs";
// nope
}];
}
[self addObservers];
[self addHomeButton];
// show loader controller during initial data download
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self performSegueWithIdentifier:SegueIdentifierInitialLoading sender:self];
});
}
#pragma mark - Private
- (void)addObservers
{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveOpenSettingsNotification:) name:NOTIFICHE_SISMI object:nil];
}
- (void)addHomeButton
{
for (UIViewController *viewController in self.viewControllers) {
UIViewController *controller = [self getTopControllerFromController:viewController];
// add hamburgher menu button
SWRevealViewController *revealViewController = self.revealViewController;
if (revealViewController && controller.navigationItem.leftBarButtonItem == nil) {
UIImage *homeImage = [UIImage imageNamed:@"navbar-icon-menu"];
UIBarButtonItem *homeButton = [[UIBarButtonItem alloc] initWithImage:homeImage
style:UIBarButtonItemStylePlain
target:revealViewController
action:@selector(revealToggle:)];
controller.navigationItem.leftBarButtonItem = homeButton;
}
}
// add pan gesture to reveal menu
[self.view addGestureRecognizer:self.revealViewController.panGestureRecognizer];
}
#pragma mark - Notifications
- (void)didReceiveOpenSettingsNotification:(NSNotification *)notification
{
[self performSegueWithIdentifier:SegueIdentifierSettings sender:nil];
}
#pragma mark - Public
- (void)sincronizza
@@ -118,11 +79,23 @@ static NSString * const SegueIdentifierLogs = @"ShowLogs";
case EQNTabBarSectionAllerte: index = 0; break;
case EQNTabBarSectionSegnalazioni: index = 1; break;
case EQNTabBarSectionRetiSismiche: index = 2; break;
case EQNTabBarSectionImpostazioni: index = 3; break;
}
self.selectedIndex = index;
}
#pragma mark - Private
- (void)saveSettings
{
[[ServerRequest defaultServerConnectionSingleton] inviaInformazioniAlServerWithURL:[EQNGeneratoreURLServer urlInvioImpostazioniNotifiche] richiesta:impostazioniNotifiche success:^(id result){
NSLog(@"Settings saved successfully");
} failure:^(NSError *error){
NSLog(@"Settings saved failed. Error: %@", error.localizedDescription);
}];
}
#pragma mark - Helpers
- (UIViewController *)getTopControllerFromController:(UIViewController *)viewController
@@ -140,6 +113,17 @@ static NSString * const SegueIdentifierLogs = @"ShowLogs";
#pragma mark - UITabBarControllerDelegate
- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController
{
// if user switch from settings page, we need to force a settings save
UIViewController *controller = [self getTopControllerFromController:tabBarController.selectedViewController];
if ([controller isKindOfClass:[SettingsViewController class]]) {
[self saveSettings];
}
return YES;
}
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
UIViewController *controller = [self getTopControllerFromController:viewController];
@@ -1,44 +0,0 @@
//
// MenuHeaderTableViewCell.swift
// Earthquake Network
//
// Created by Busi Andrea on 27/07/2020.
// Copyright © 2020 Earthquake Network. All rights reserved.
//
import UIKit
class MenuHeaderTableViewCell: UITableViewCell {
@IBOutlet weak var appIconImageView: UIImageView!
@IBOutlet weak var appVersionLabel: UILabel!
@IBOutlet weak var appIdLabel: UILabel!
// MARK: - View Lifecycle
override func awakeFromNib() {
super.awakeFromNib()
// add a gradient for the background
let gradient = CAGradientLayer()
let blueColor = UIColor(red: 131.0/255.0, green: 200.0/255.0, blue: 255.0/255.0, alpha: 1.0)
gradient.frame = bounds
gradient.colors = [ blueColor.cgColor, UIColor.white.cgColor ]
layer.insertSublayer(gradient, at: 0)
}
// MARK: - Public
func updateUI() {
if let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String {
let version = NSLocalizedString("Versione", comment: "etichetta versione app")
appVersionLabel.text = "\(version): \(appVersion)"
}
let userId = EQNUser.default().user_ID ?? "n.d."
appIdLabel.text = "ID: \(userId)"
let image = EQNPurchaseUtility.isProVersionEnabled() ? UIImage(named: "eq_icon_pro")! : UIImage(named: "eq_icon")!
appIconImageView.image = image
}
}
@@ -1,45 +0,0 @@
//
// MenuItemTableViewCell.swift
// Earthquake Network
//
// Created by Busi Andrea on 27/07/2020.
// Copyright © 2020 Earthquake Network. All rights reserved.
//
import UIKit
class MenuItemTableViewCell: UITableViewCell {
@IBOutlet private weak var itemIconImageView: UIImageView!
@IBOutlet private weak var itemTitleLabel: UILabel!
var item: MenuViewController.MenuItem? {
didSet {
updateUI()
}
}
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
// MARK: - Private
private func updateUI() {
guard let item = item else { return }
if let iconName = item.icon {
itemIconImageView.tintColor = .darkGray
itemIconImageView.image = UIImage(named: iconName)
}
itemTitleLabel.textColor = .darkGray
itemTitleLabel.text = item.title
}
}
@@ -1,125 +0,0 @@
//
// MenuViewController.swift
// Earthquake Network
//
// Created by Busi Andrea on 27/07/2020.
// Copyright © 2020 Earthquake Network. All rights reserved.
//
import UIKit
import SafariServices
class MenuViewController: UITableViewController {
enum MenuItem: CaseIterable {
case header
case settings
case informations
case faq
case help
case author
case sponsors
case disclaimer
case privacy
var title: String {
switch self {
case .header: return ""
case .settings: return NSLocalizedString("Impostazioni", comment: "voce menu")
case .informations: return NSLocalizedString("Informazioni", comment: "voce menu")
case .faq: return NSLocalizedString("F.A.Q.", comment: "voce menu")
case .help: return NSLocalizedString("Help", comment: "voce menu")
case .author: return NSLocalizedString("Autore", comment: "voce menu")
case .sponsors: return NSLocalizedString("Patrocinatori", comment: "voce menu")
case .disclaimer: return NSLocalizedString("Disclaimer", comment: "voce menu")
case .privacy: return NSLocalizedString("Privacy", comment: "voce menu")
}
}
var icon: String? {
switch self {
case .header: return nil
case .settings: return "menu-icon-settings"
case .informations: return "menu-icon-info"
case .faq: return "menu-icon-faq"
case .help: return "menu-icon-help"
case .author: return "menu-icon-author"
case .sponsors: return "menu-icon-sponsors"
case .disclaimer: return "menu-icon-terms"
case .privacy: return "menu-icon-privacy"
}
}
}
private let items = MenuItem.allCases
private static let CellIdentifierHeader = "HeaderCell"
private static let CellIdentifierItem = "MenuItemCell"
// MARK: - View Lifecycle
override func viewDidLoad() {
super.viewDidLoad()
}
// MARK: - Table view data source
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
items.count
}
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
let item = items[indexPath.row]
if item == .header {
return 160
}
return 60
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let item = items[indexPath.row]
if item == .header {
let cell = tableView.dequeueReusableCell(withIdentifier: Self.CellIdentifierHeader, for: indexPath) as! MenuHeaderTableViewCell
cell.updateUI()
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: Self.CellIdentifierItem, for: indexPath) as! MenuItemTableViewCell
cell.item = item
return cell
}
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
self.revealViewController()?.revealToggle(animated: true)
let item = items[indexPath.row]
switch item {
case .header:
break
case .settings:
NotificationCenter.default.post(name: NSNotification.Name(rawValue: NOTIFICHE_SISMI), object: nil)
default:
// open url if available
if let url = externalUrl(for: item) {
let controller = SFSafariViewController(url: url)
present(controller, animated: true, completion: nil)
}
}
}
// MARK: - Private
private func externalUrl(for item: MenuItem) -> URL? {
let baseUrl = EQNWebsiteAddress
switch item {
case .informations: return URL(string: "\(baseUrl)")
case .faq: return URL(string: "\(baseUrl)/f-a-q/")
case .help: return URL(string: "\(baseUrl)/help/")
case .author: return URL(string: "\(baseUrl)/contact/")
case .sponsors: return URL(string: "\(baseUrl)/sponsors/")
case .disclaimer: return URL(string: "\(baseUrl)/terms-conditions/")
case .privacy: return URL(string: "\(baseUrl)/privacy/")
default: return nil
}
}
}
@@ -12,8 +12,6 @@ import Foundation
class SettingDateTableViewCell: UITableViewCell {
@objc static let Identifier = "DateCell"
private static let ValueColor = UIColor.blue
private static let TextColor = UIColor.black
@objc var isDisabled: Bool = false {
didSet {
@@ -38,6 +36,7 @@ class SettingDateTableViewCell: UITableViewCell {
label.translatesAutoresizingMaskIntoConstraints = false
label.numberOfLines = 0
label.font = UIFont.preferredFont(forTextStyle: .body)
label.textColor = AppTheme.shared.textColor
return label
}()
@@ -46,7 +45,7 @@ class SettingDateTableViewCell: UITableViewCell {
label.translatesAutoresizingMaskIntoConstraints = false
label.numberOfLines = 0
label.font = UIFont.preferredFont(forTextStyle: .subheadline)
label.textColor = Self.ValueColor
label.textColor = AppTheme.shared.valueColor
return label
}()
@@ -104,8 +103,9 @@ class SettingDateTableViewCell: UITableViewCell {
}
private func updateUI() {
titleLabel.textColor = isDisabled ? .lightGray : Self.TextColor
valuesLabel.textColor = isDisabled ? .lightGray : Self.ValueColor
let theme = AppTheme.shared
titleLabel.textColor = isDisabled ? theme.textDisabledColor : theme.textColor
valuesLabel.textColor = isDisabled ? theme.textDisabledColor : theme.textColor
if isPickerVisible && !stackView.arrangedSubviews.contains(datePicker) {
stackView.addArrangedSubview(datePicker)
@@ -12,8 +12,6 @@ import Foundation
class SettingMultivaluesTableViewCell: UITableViewCell {
@objc static let Identifier = "MultivaluesCell"
private static let ValueColor = UIColor.blue
private static let TextColor = UIColor.black
@objc var isDisabled: Bool = false {
didSet {
@@ -28,6 +26,7 @@ class SettingMultivaluesTableViewCell: UITableViewCell {
label.translatesAutoresizingMaskIntoConstraints = false
label.numberOfLines = 0
label.font = UIFont.preferredFont(forTextStyle: .body)
label.textColor = AppTheme.shared.textColor
return label
}()
@@ -36,7 +35,7 @@ class SettingMultivaluesTableViewCell: UITableViewCell {
label.translatesAutoresizingMaskIntoConstraints = false
label.numberOfLines = 0
label.font = UIFont.preferredFont(forTextStyle: .subheadline)
label.textColor = Self.ValueColor
label.textColor = AppTheme.shared.valueColor
return label
}()
@@ -75,7 +74,8 @@ class SettingMultivaluesTableViewCell: UITableViewCell {
}
private func updateUI() {
titleLabel.textColor = isDisabled ? .lightGray : Self.TextColor
valuesLabel.textColor = isDisabled ? .lightGray : Self.ValueColor
let theme = AppTheme.shared
titleLabel.textColor = isDisabled ? theme.textDisabledColor : theme.textColor
valuesLabel.textColor = isDisabled ? theme.textDisabledColor : theme.valueColor
}
}
@@ -12,7 +12,6 @@ import Foundation
class SettingSegmentedTableViewCell: UITableViewCell {
@objc static let Identifier = "SegmentedCell"
private static let TextColor = UIColor.black
@objc var isDisabled: Bool = false {
didSet {
@@ -29,6 +28,7 @@ class SettingSegmentedTableViewCell: UITableViewCell {
label.translatesAutoresizingMaskIntoConstraints = false
label.numberOfLines = 0
label.font = UIFont.preferredFont(forTextStyle: .body)
label.textColor = AppTheme.shared.textColor
return label
}()
@@ -75,7 +75,8 @@ class SettingSegmentedTableViewCell: UITableViewCell {
}
private func updateUI() {
titleLabel.textColor = isDisabled ? .lightGray : Self.TextColor
let theme = AppTheme.shared
titleLabel.textColor = isDisabled ? theme.textDisabledColor : theme.textColor
segmentedControl.isEnabled = !isDisabled
}
@@ -11,8 +11,6 @@ import UIKit
class SettingSliderTableViewCell: UITableViewCell {
@objc static let Identifier = "SliderCell"
private static let ValueColor = UIColor.blue
private static let TextColor = UIColor.black
@objc var isDisabled: Bool = false {
didSet {
@@ -30,6 +28,7 @@ class SettingSliderTableViewCell: UITableViewCell {
label.translatesAutoresizingMaskIntoConstraints = false
label.numberOfLines = 0
label.font = UIFont.preferredFont(forTextStyle: .body)
label.textColor = AppTheme.shared.textColor
return label
}()
@@ -38,7 +37,7 @@ class SettingSliderTableViewCell: UITableViewCell {
label.translatesAutoresizingMaskIntoConstraints = false
label.numberOfLines = 0
label.font = UIFont.preferredFont(forTextStyle: .subheadline)
label.textColor = Self.ValueColor
label.textColor = AppTheme.shared.valueColor
return label
}()
@@ -86,8 +85,9 @@ class SettingSliderTableViewCell: UITableViewCell {
}
private func updateUI() {
titleLabel.textColor = isDisabled ? .lightGray : Self.TextColor
valueLabel.textColor = isDisabled ? .lightGray : Self.ValueColor
let theme = AppTheme.shared
titleLabel.textColor = isDisabled ? theme.textDisabledColor : theme.textColor
valueLabel.textColor = isDisabled ? theme.textDisabledColor : theme.valueColor
slider.isEnabled = !isDisabled
}
@@ -1,8 +1,8 @@
//
// SettingsViewController.h
// SettingsBaseViewController.h
// Earthquake Network
//
// Refactored by Andrea Busi 25/08/2020.
// Created by Busi Andrea on 30/08/2020.
// Copyright © 2020 Earthquake Network. All rights reserved.
//
@@ -10,7 +10,7 @@
NS_ASSUME_NONNULL_BEGIN
@interface SettingsViewController : UITableViewController
@interface SettingsBaseViewController : UITableViewController
@end
@@ -0,0 +1,42 @@
//
// SettingsBaseViewController.m
// Earthquake Network
//
// Created by Busi Andrea on 30/08/2020.
// Copyright © 2020 Earthquake Network. All rights reserved.
//
#import "SettingsBaseViewController.h"
#import "ServerRequest.h"
#import "EQNGeneratoreURLServer.h"
@interface SettingsBaseViewController ()
@end
@implementation SettingsBaseViewController
#pragma mark - View Lifecycle
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
// when controller is dismissed, save settings
if (self.isMovingFromParentViewController) {
[self saveSettings];
}
}
#pragma mark - Private
- (void)saveSettings
{
[[ServerRequest defaultServerConnectionSingleton] inviaInformazioniAlServerWithURL:[EQNGeneratoreURLServer urlInvioImpostazioniNotifiche] richiesta:impostazioniNotifiche success:^(id result){
NSLog(@"Settings saved successfully");
} failure:^(NSError *error){
NSLog(@"Settings saved failed. Error: %@", error.localizedDescription);
}];
}
@end
@@ -7,10 +7,11 @@
//
#import <UIKit/UIKit.h>
#import "SettingsBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface SettingsRealTimeAlertsViewController : UITableViewController
@interface SettingsRealTimeAlertsViewController : SettingsBaseViewController
@end
@@ -27,7 +27,6 @@
@property (nonatomic, strong) NSDateFormatter *dateFormatter;
@property (nonatomic, assign) BOOL notificationEnabled;
@property (nonatomic, assign) BOOL notificationNoEnergySeismicEnabled;
@property (nonatomic, assign) BOOL doNotDisturbEnabled;
@end
@@ -36,7 +35,6 @@
typedef NS_ENUM(NSInteger, RowIdentifier) {
RowIdentifierAbilitaNotifiche = 0,
RowIdentifierSismiDaNotificare,
RowIdentifierAbilitaSismiSenzaIntensita,
RowIdentifierRaggioSismiLievi,
RowIndntifierRaggioSismiForti,
RowIdentifierNonDisturbare,
@@ -66,9 +64,8 @@ typedef NS_ENUM(NSInteger, RowIdentifier) {
self.settings = @[
[[SettingItem alloc] initWithType:SettingTypeEnable title:NSLocalizedString(@"Suona un allarme quando un sisma è rilevato dalla rete smartphone", @"")],
[[SettingItem alloc] initWithType:SettingTypeSegmented title:NSLocalizedString(@"Sismi da notificare", @"") subtitle:NSLocalizedString(@"", @"")],
[[SettingItem alloc] initWithType:SettingTypeEnable title:NSLocalizedString(@"Sismi senza intensità", @"") subtitle:NSLocalizedString(@"Attiva l'allerta anche su i sismi per i quali non è possibile stimare l'intensità", @"")],
[[SettingItem alloc] initWithType:SettingTypeSlider title:NSLocalizedString(@"Raggio sismi lievi", @"")],
[[SettingItem alloc] initWithType:SettingTypeSlider title:NSLocalizedString(@"Raggio sismi forti o intensità non disponibile", @"")]
[[SettingItem alloc] initWithType:SettingTypeSlider title:NSLocalizedString(@"Raggio sismi forti", @"")]
];
// these settings are disabled because on iOS app are not handled
@@ -88,6 +85,8 @@ typedef NS_ENUM(NSInteger, RowIdentifier) {
- (void)setupUI
{
self.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeNever;
self.tableView.estimatedRowHeight = 200.0;
self.tableView.rowHeight = UITableViewAutomaticDimension;
[self.tableView registerClass:[SettingSectionHeaderView class] forHeaderFooterViewReuseIdentifier:SettingSectionHeaderView.Identifier];
@@ -101,7 +100,6 @@ typedef NS_ENUM(NSInteger, RowIdentifier) {
- (void)updateUI
{
self.notificationEnabled = [EQNAllertaSismica center].isAbilitato;
self.notificationNoEnergySeismicEnabled = [EQNAllertaSismica center].isSimiSenzaIntensita;
self.doNotDisturbEnabled = [EQNAllertaSismica center].isintervalloAllarme;
// sismi da notificare
@@ -165,15 +163,6 @@ typedef NS_ENUM(NSInteger, RowIdentifier) {
[[EQNAllertaSismica center] saveUserInfo];
[self.tableView reloadData];
};
} else if (indexPath.row == RowIdentifierAbilitaSismiSenzaIntensita) {
cell.toggleSwitch.on = self.notificationNoEnergySeismicEnabled;
cell.isDisabled = !self.notificationEnabled;
cell.valueChanged = ^(BOOL enabled) {
self.notificationNoEnergySeismicEnabled = enabled;
[EQNAllertaSismica center].isSimiSenzaIntensita = self.notificationNoEnergySeismicEnabled;
[[EQNAllertaSismica center] saveUserInfo];
[self.tableView reloadData];
};
} else if (indexPath.row == RowIdentifierNonDisturbare) {
cell.toggleSwitch.on = self.doNotDisturbEnabled;
cell.isDisabled = !self.notificationEnabled;
@@ -7,10 +7,11 @@
//
#import <UIKit/UIKit.h>
#import "SettingsBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface SettingsSeismicNetworkAlertsViewController : UITableViewController
@interface SettingsSeismicNetworkAlertsViewController : SettingsBaseViewController
@end
@@ -37,7 +37,6 @@ typedef NS_ENUM(NSInteger, RowIdentifier) {
RowIdentifierRaggioPosizione,
RowIdentifierEnergiaSisma,
RowIdentifierTerremotiVicini,
RowIdentifierTerremotiViciniDistanza,
RowIdentifierTerremotiForti,
RowIdentifierTerremotiFortiDistanza
};
@@ -55,8 +54,7 @@ typedef NS_ENUM(NSInteger, RowIdentifier) {
[[SettingItem alloc] initWithType:SettingTypeMultiValues title:NSLocalizedString(@"Reti sismiche", @"") segue:SegueIdentifierListaEnti],
[[SettingItem alloc] initWithType:SettingTypeSlider title:NSLocalizedString(@"Raggio dalla tua posizione", @"")],
[[SettingItem alloc] initWithType:SettingTypeSlider title:NSLocalizedString(@"Energia sisma", @"")],
[[SettingItem alloc] initWithType:SettingTypeEnable title:NSLocalizedString(@"Terremoti vicini", @"") subtitle:NSLocalizedString(@"Notifica sismi di qualsiasi magnitudo se la distanza è inferiore a", @"")],
[[SettingItem alloc] initWithType:SettingTypeSlider title:NSLocalizedString(@"Distanza", @"")],
[[SettingItem alloc] initWithType:SettingTypeEnable title:NSLocalizedString(@"Terremoti vicini", @"") subtitle:NSLocalizedString(@"Notifica sismi di qualsiasi magnitudo se la distanza è inferiore a 50 km", @"")],
[[SettingItem alloc] initWithType:SettingTypeEnable title:NSLocalizedString(@"Terremoti forti", @"") subtitle:NSLocalizedString(@"Notifica sismi forti a qualsiasi distanza se la magnitudo è maggiore a", @"")],
[[SettingItem alloc] initWithType:SettingTypeSlider title:NSLocalizedString(@"Magnitudo", @"")]
];
@@ -78,6 +76,8 @@ typedef NS_ENUM(NSInteger, RowIdentifier) {
- (void)setupUI
{
self.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeNever;
self.tableView.estimatedRowHeight = 200.0;
self.tableView.rowHeight = UITableViewAutomaticDimension;
[self.tableView registerClass:[SettingSectionHeaderView class] forHeaderFooterViewReuseIdentifier:SettingSectionHeaderView.Identifier];
@@ -204,12 +204,6 @@ typedef NS_ENUM(NSInteger, RowIdentifier) {
cell.valueChanged = ^(EQNGenericValue *item) {
[self updateSeismicEnergy:item];
};
} else if (indexPath.row == RowIdentifierTerremotiViciniDistanza) {
cell.isDisabled = !self.notificationEnabled || !self.notificationNearEarthquakeEnabled;
[cell configureSliderWith:self.dataSourceRaggioSisma current:self.currentNearEarthquakeDistance];
cell.valueChanged = ^(EQNGenericValue *item) {
[self updateNearEarthquakeDistance:item];
};
} else if (indexPath.row == RowIdentifierTerremotiFortiDistanza) {
cell.isDisabled = !self.notificationEnabled || !self.notificationStrongEarthquakeEnabled;
[cell configureSliderWith:self.dataSourceMagnitudoForti current:self.currentStrongEarthquakeDistance];
@@ -250,14 +244,6 @@ typedef NS_ENUM(NSInteger, RowIdentifier) {
[self updateUI];
}
- (void)updateNearEarthquakeDistance:(EQNGenericValue *)distance
{
[EQNNotificeReteSismiche center].distanzaVicini = distance.value;
[[EQNNotificeReteSismiche center] saveUserInfo];
[self updateUI];
}
- (void)updateStrongEarthquakeEnergy:(EQNGenericValue *)energy
{
[EQNNotificeReteSismiche center].energiaTerremotiForti = energy.value;
@@ -7,10 +7,11 @@
//
#import <UIKit/UIKit.h>
#import "SettingsBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface SettingsUserReportAlertsViewController : UITableViewController
@interface SettingsUserReportAlertsViewController : SettingsBaseViewController
@end
@@ -39,6 +39,8 @@
- (void)setupUI
{
self.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeNever;
self.tableView.estimatedRowHeight = 100.0;
self.tableView.rowHeight = UITableViewAutomaticDimension;
[self.tableView registerClass:[SettingSectionHeaderView class] forHeaderFooterViewReuseIdentifier:SettingSectionHeaderView.Identifier];
@@ -1,79 +0,0 @@
//
// SettingsViewController.m
// Earthquake Network
//
// Refactored by Andrea Busi 25/08/2020.
// Copyright © 2020 Earthquake Network. All rights reserved.
//
#import "SettingsViewController.h"
#import "ServerRequest.h"
#import "EQNGeneratoreURLServer.h"
@interface SettingsViewController ()
@property (nonatomic, strong) NSArray<SettingItem *> *settings;
@end
@implementation SettingsViewController
static NSString * const SegueIdentifierAllertaSismica = @"ShowAllertaSismica";
static NSString * const SegueIdentifierNotificheSegnalazioniUtente = @"ShowNotificheSegnalazioniUtente";
static NSString * const SegueIdentifierNotificheRetiSismiche = @"ShowNotificheRetiSismiche";
#pragma mark - View Lifecycle
- (void)viewDidLoad
{
[super viewDidLoad];
self.title = NSLocalizedString(@"Impostazioni", @"");
[self.tableView registerClass:[SettingDetailTableViewCell class] forCellReuseIdentifier:SettingDetailTableViewCell.Identifier];
self.settings = @[
[[SettingItem alloc] initWithType:SettingTypeDetail title:NSLocalizedString(@"Allerta in tempo reale", @"") subtitle:nil icon:@"🚨" segue:SegueIdentifierAllertaSismica],
[[SettingItem alloc] initWithType:SettingTypeDetail title:NSLocalizedString(@"Notifiche da reti sismiche", @"") subtitle:nil icon:@"🔔" segue:SegueIdentifierNotificheRetiSismiche],
[[SettingItem alloc] initWithType:SettingTypeDetail title:NSLocalizedString(@"Notifiche segnalazioni utente", @"") subtitle:nil icon:@"🔔" segue:SegueIdentifierNotificheSegnalazioniUtente]
];
}
#pragma mark - Table view data source
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return self.settings.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
SettingDetailTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:SettingDetailTableViewCell.Identifier forIndexPath:indexPath];
SettingItem *setting = self.settings[indexPath.row];
cell.textLabel.text = setting.displayTitle;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
SettingItem *setting = self.settings[indexPath.row];
if (setting.segue) {
[self performSegueWithIdentifier:setting.segue sender:nil];
}
}
#pragma mark - Actions
- (IBAction)closeTapped:(id)sender
{
[[ServerRequest defaultServerConnectionSingleton] inviaInformazioniAlServerWithURL:[EQNGeneratoreURLServer urlInvioImpostazioniNotifiche] richiesta:impostazioniNotifiche success:^(id result){
dispatch_async(dispatch_get_main_queue(), ^{
[self dismissViewControllerAnimated:YES completion:nil];
});
} failure:^(NSError *error){
dispatch_async(dispatch_get_main_queue(), ^{
[self dismissViewControllerAnimated:YES completion:nil];
});
}];
}
@end
@@ -0,0 +1,128 @@
//
// SettingsViewController.swift
// Earthquake Network
//
// Created by Busi Andrea on 30/08/2020.
// Copyright © 2020 Earthquake Network. All rights reserved.
//
import UIKit
import SafariServices
class SettingsViewController: UITableViewController {
private static let SegueIdentifierAllertaSismica = "ShowAllertaSismica"
private static let SegueIdentifierNotificheSegnalazioniUtente = "ShowNotificheSegnalazioniUtente"
private static let SegueIdentifierNotificheRetiSismiche = "ShowNotificheRetiSismiche"
private static let SegueIdentifierSafari = "ShowSafari"
private enum InfoItem: Int {
case informations
case faq
case help
case author
case sponsors
case disclaimer
case privacy
var externalUrl: URL? {
let baseUrl = EQNWebsiteAddress
switch self {
case .informations: return URL(string: "\(baseUrl)")
case .faq: return URL(string: "\(baseUrl)/f-a-q/")
case .help: return URL(string: "\(baseUrl)/help/")
case .author: return URL(string: "\(baseUrl)/contact/")
case .sponsors: return URL(string: "\(baseUrl)/sponsors/")
case .disclaimer: return URL(string: "\(baseUrl)/terms-conditions/")
case .privacy: return URL(string: "\(baseUrl)/privacy/")
}
}
}
private var settings: [[SettingItem]] = [
[
SettingItem(type: .detail, title: NSLocalizedString("Allerta in tempo reale", comment: ""), segue: SegueIdentifierAllertaSismica, emoji: "🚨"),
SettingItem(type: .detail, title: NSLocalizedString("Notifiche da reti sismiche", comment: ""), segue: SegueIdentifierNotificheRetiSismiche, emoji: "🔔"),
SettingItem(type: .detail, title: NSLocalizedString("Notifiche segnalazioni utente", comment: ""), segue: SegueIdentifierNotificheSegnalazioniUtente, emoji: "🔔")
],
[
SettingItem(type: .detail, title: NSLocalizedString("Informazioni", comment: ""), segue: SegueIdentifierSafari, icon: "menu-icon-info"),
SettingItem(type: .detail, title: NSLocalizedString("F.A.Q.", comment: ""), segue: SegueIdentifierSafari, icon: "menu-icon-faq"),
SettingItem(type: .detail, title: NSLocalizedString("Help", comment: ""), segue: SegueIdentifierSafari, icon: "menu-icon-help"),
SettingItem(type: .detail, title: NSLocalizedString("Autore", comment: ""), segue: SegueIdentifierSafari, icon: "menu-icon-author"),
SettingItem(type: .detail, title: NSLocalizedString("Patrocinatori", comment: ""), segue: SegueIdentifierSafari, icon: "menu-icon-sponsors"),
SettingItem(type: .detail, title: NSLocalizedString("Disclaimer", comment: ""), segue: SegueIdentifierSafari, icon: "menu-icon-terms"),
SettingItem(type: .detail, title: NSLocalizedString("Privacy", comment: ""), segue: SegueIdentifierSafari, icon: "menu-icon-privacy")
]
]
// MARK: - View Lifecycle
override func viewDidLoad() {
super.viewDidLoad()
title = NSLocalizedString("Impostazioni", comment: "")
setupUI()
}
// MARK: - Private
private func setupUI() {
tableView.register(SettingDetailTableViewCell.self, forCellReuseIdentifier: SettingDetailTableViewCell.Identifier)
tableView.contentInset = UIEdgeInsets(top: 20.0, left: 0.0, bottom: 0.0, right: 0.0)
}
// MARK: - Table view data source
override func numberOfSections(in tableView: UITableView) -> Int {
settings.count
}
override func tableView(_ tableView: UITableView, titleForFooterInSection section: Int) -> String? {
if section == 0 {
return nil
}
var title = ""
if let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String {
let version = NSLocalizedString("Versione", comment: "etichetta versione app")
title = "\(version): \(appVersion)"
}
let userId = EQNUser.default().user_ID ?? "n.d."
title = "\(title) - User id: \(userId)"
return title
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
let aSection = settings[section]
return aSection.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let setting = settings[indexPath.section][indexPath.row]
let cell = tableView.dequeueReusableCell(withIdentifier: SettingDetailTableViewCell.Identifier, for: indexPath) as! SettingDetailTableViewCell
cell.textLabel?.text = setting.displayTitle
if let icon = setting.icon {
cell.imageView?.tintColor = .darkGray
cell.imageView?.image = UIImage(named: icon)
}
cell.accessoryType = .disclosureIndicator
return cell
}
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
let setting = settings[indexPath.section][indexPath.row]
if let segue = setting.segue {
if segue == Self.SegueIdentifierSafari, let item = InfoItem(rawValue: indexPath.row), let url = item.externalUrl {
// show Safari with the given URL
let controller = SFSafariViewController(url: url)
present(controller, animated: true, completion: nil)
} else {
performSegue(withIdentifier: segue, sender: nil)
}
}
}
}
-3
View File
@@ -240,7 +240,6 @@ typedef enum : NSInteger {
/////////////////////////////////// impostazioni ////////////////////////////////////
#define NOTIFICHE_SISMI @"NOTIFICHE_SISMI"
#define NOTIFICHE_ORA_INIZIO @"NOTIFICHE_ORA_INIZIO"
#define NOTIFICHE_ORA_FINE @"NOTIFICHE_ORA_FINE"
#define NOTIFICHE_ATTIVA_ORARIO @"NOTIFICHE_ATTIVA_ORARIO"
@@ -263,7 +262,6 @@ typedef enum : NSInteger {
#define NOTIFICHE_ATTIVA_RETI_SISMICHE_VICINE @"NOTIFICHE_ATTIVA_RETI_SISMICHE_VICINE"
#define NOTIFICHE_ATTIVA_RETI_TERREMOTI_FORTI @"NOTIFICHE_ATTIVA_RETI_TERREMOTI_FORTI"
#define NOTIFICHE_ATTIVA_RETI_ENERGIA_SISMI @"NOTIFICHE_ATTIVA_RETI_ENERGIA_SISMI"
#define NOTIFICHE_ATTIVA_RETI_DISTANZA_VICINI @"NOTIFICHE_ATTIVA_RETI_DISTANZA_VICINI"
#define NOTIFICHE_ATTIVA_RETI_ENERGIA_FORTI @"NOTIFICHE_ATTIVA_RETI_ENERGIA_FORTI"
#define NOTIFICHE_ATTIVA_RETI_LISTA_ENTI @"NOTIFICHE_ATTIVA_RETI_LISTA_ENTI"
@@ -284,7 +282,6 @@ typedef enum : NSInteger {
/////////////////// Allera sismica ////////////////////////////
#define NOTIFICHE_ALLERA_SISMICA_ABILITATO @"NOTIFICHE_ALLERA_SISMICA_ABILITATO"
#define NOTIFICHE_ALLERA_SISMICA_SISMI_DA_NOTIFICARE @"NOTIFICHE_ALLERA_SISMICA_SISMI_DA_NOTIFICARE"
#define NOTIFICHE_ALLERA_SISMICA_SENZA_INTENSITA @"NOTIFICHE_ALLERA_SISMICA_SENZA_INTENSITA"
#define NOTIFICHE_ALLERA_SISMICA_RAGGIO_SISMI_LIEVI @"NOTIFICHE_ALLERA_SISMICA_RAGGIO_SISMI_LIEVI"
#define NOTIFICHE_ALLERA_SISMICA_RAGGIO_SISMI_FORTI @"NOTIFICHE_ALLERA_SISMICA_RAGGIO_SISMI_FORTI"
#define NOTIFICHE_ALLERA_SISMICA_TONO_ALLARME @"NOTIFICHE_ALLERA_SISMICA_TONO_ALLARME"
@@ -5,6 +5,5 @@
#import "EQNUtility.h"
#import "Costanti.h"
#import "EQNUser.h"
#import "SWRevealViewController.h"
#import "EQNManager.h"
#import "EQNNotificeReteSismiche.h"
@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>_XCCurrentVersionName</key>
<string>Earthquake_Network.xcdatamodel</string>
</dict>
</plist>
@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="1" systemVersion="11A491" minimumToolsVersion="Automatic" sourceLanguage="Objective-C" userDefinedModelVersionIdentifier="">
<elements/>
</model>
@@ -49,5 +49,8 @@ public class EQNAppearanceCommand: EQNCommandProtocol {
NSAttributedString.Key.foregroundColor: UIColor.white
]
}
let proxyTabBar = UITabBar.appearance()
proxyTabBar.tintColor = UIColor(named: "Red")!
}
}
@@ -22,13 +22,14 @@ import Foundation
class SettingItem: NSObject {
let title: String
let subtitle: String?
let icon: String?
let segue: String?
let icon: String?
let emoji: String?
let type: SettingType
var displayTitle: String {
if let icon = icon {
return "\(icon) \(title)"
if let emoji = emoji {
return "\(emoji) \(title)"
}
return title
}
@@ -36,22 +37,31 @@ class SettingItem: NSObject {
// MARK: - Init
convenience init(type: SettingType, title: String) {
self.init(type: type, title: title, subtitle: nil, icon: nil, segue: nil)
self.init(type: type, title: title, subtitle: nil, segue: nil, icon: nil, emoji: nil)
}
convenience init(type: SettingType, title: String, subtitle: String) {
self.init(type: type, title: title, subtitle: subtitle, icon: nil, segue: nil)
self.init(type: type, title: title, subtitle: subtitle, segue: nil, icon: nil, emoji: nil)
}
convenience init(type: SettingType, title: String, segue: String) {
self.init(type: type, title: title, subtitle: nil, icon: nil, segue: segue)
self.init(type: type, title: title, subtitle: nil, segue: segue, icon: nil, emoji: nil)
}
init(type: SettingType, title: String, subtitle: String? = nil, icon: String? = nil, segue: String? = nil) {
convenience init(type: SettingType, title: String, segue: String, icon: String) {
self.init(type: type, title: title, subtitle: nil, segue: segue, icon: icon, emoji: nil)
}
convenience init(type: SettingType, title: String, segue: String, emoji: String) {
self.init(type: type, title: title, subtitle: nil, segue: segue, icon: nil, emoji: emoji)
}
init(type: SettingType, title: String, subtitle: String? = nil, segue: String? = nil, icon: String? = nil, emoji: String? = nil) {
self.type = type
self.title = title
self.subtitle = subtitle
self.icon = icon
self.segue = segue
self.icon = icon
self.emoji = emoji
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 281 KiB

After

Width:  |  Height:  |  Size: 323 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 22 KiB

@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "tabbar-icon-settings.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "tabbar-icon-settings@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "tabbar-icon-settings@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="CWo-PE-Dqp">
<device id="retina4_0" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
@@ -9,135 +9,6 @@
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Reveal View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="SWRevealViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
<connections>
<segue destination="eii-Cp-KHa" kind="custom" identifier="sw_rear" customClass="SWRevealViewControllerSegueSetController" id="j9t-68-btW"/>
<segue destination="CWo-PE-Dqp" kind="custom" identifier="sw_front" customClass="SWRevealViewControllerSegueSetController" id="KKC-Jh-8bw"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-13671" y="-5580"/>
</scene>
<!--Menu View Controller-->
<scene sceneID="now-fp-f7G">
<objects>
<tableViewController id="tfK-2z-1RF" customClass="MenuViewController" customModule="Earthquake_Network" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" id="Uli-am-paJ">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" reuseIdentifier="HeaderCell" rowHeight="160" id="jYz-Xr-aDl" customClass="MenuHeaderTableViewCell" customModule="Earthquake_Network" customModuleProvider="target">
<rect key="frame" x="0.0" y="28" width="320" height="160"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="jYz-Xr-aDl" id="e0N-qN-ftV">
<rect key="frame" x="0.0" y="0.0" width="320" height="160"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="eq_icon" translatesAutoresizingMaskIntoConstraints="NO" id="GsY-wf-MH4">
<rect key="frame" x="16" y="11" width="80" height="80"/>
<constraints>
<constraint firstAttribute="height" constant="80" id="8rZ-8q-CEF"/>
<constraint firstAttribute="width" constant="80" id="u8q-3f-KFe"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" tag="1" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="giY-Wc-DhN">
<rect key="frame" x="16" y="91" width="288" height="31"/>
<constraints>
<constraint firstAttribute="height" constant="31" id="TGT-3L-KhB"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" tag="2" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="j4G-Ck-LqX">
<rect key="frame" x="16" y="122" width="288" height="31"/>
<constraints>
<constraint firstAttribute="height" constant="31" id="gwH-Ve-GUI"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="j4G-Ck-LqX" firstAttribute="trailing" secondItem="giY-Wc-DhN" secondAttribute="trailing" id="6Q0-lM-hG5"/>
<constraint firstItem="giY-Wc-DhN" firstAttribute="top" secondItem="GsY-wf-MH4" secondAttribute="bottom" id="FeZ-Bd-PmL"/>
<constraint firstItem="GsY-wf-MH4" firstAttribute="top" secondItem="e0N-qN-ftV" secondAttribute="topMargin" id="G3i-2n-2Nx"/>
<constraint firstItem="giY-Wc-DhN" firstAttribute="leading" secondItem="e0N-qN-ftV" secondAttribute="leadingMargin" id="Hlj-vj-cMX"/>
<constraint firstItem="j4G-Ck-LqX" firstAttribute="leading" secondItem="giY-Wc-DhN" secondAttribute="leading" id="WqA-oM-rtc"/>
<constraint firstItem="GsY-wf-MH4" firstAttribute="leading" secondItem="e0N-qN-ftV" secondAttribute="leadingMargin" id="bKf-l2-fgW"/>
<constraint firstItem="giY-Wc-DhN" firstAttribute="trailing" secondItem="e0N-qN-ftV" secondAttribute="trailingMargin" id="gWP-PH-C5A"/>
<constraint firstItem="j4G-Ck-LqX" firstAttribute="top" secondItem="giY-Wc-DhN" secondAttribute="bottom" id="t3q-9c-4XH"/>
</constraints>
</tableViewCellContentView>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<connections>
<outlet property="appIconImageView" destination="GsY-wf-MH4" id="J6K-KM-flY"/>
<outlet property="appIdLabel" destination="j4G-Ck-LqX" id="deq-7c-3yB"/>
<outlet property="appVersionLabel" destination="giY-Wc-DhN" id="Q4a-4m-lMG"/>
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="MenuItemCell" rowHeight="61" id="298-4Q-jvK" customClass="MenuItemTableViewCell" customModule="Earthquake_Network" customModuleProvider="target">
<rect key="frame" x="0.0" y="188" width="320" height="61"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="298-4Q-jvK" id="s9v-lL-UoX">
<rect key="frame" x="0.0" y="0.0" width="320" height="61"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" tag="2" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="EHJ-P0-fGN">
<rect key="frame" x="18" y="18" width="25" height="25"/>
<constraints>
<constraint firstAttribute="height" constant="25" id="14j-ME-Jqu"/>
<constraint firstAttribute="width" constant="25" id="5RH-3v-giy"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" tag="1" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zCw-yW-TG3">
<rect key="frame" x="51" y="11" width="248" height="39"/>
<constraints>
<constraint firstAttribute="height" constant="39" id="OF3-NL-KQB"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="EHJ-P0-fGN" firstAttribute="leading" secondItem="s9v-lL-UoX" secondAttribute="leading" constant="18" id="5oY-qP-ZGM"/>
<constraint firstItem="zCw-yW-TG3" firstAttribute="leading" secondItem="EHJ-P0-fGN" secondAttribute="trailing" constant="8" id="5r0-32-jYW"/>
<constraint firstItem="EHJ-P0-fGN" firstAttribute="centerY" secondItem="s9v-lL-UoX" secondAttribute="centerY" id="Uri-pK-eVO"/>
<constraint firstAttribute="trailingMargin" secondItem="zCw-yW-TG3" secondAttribute="trailing" constant="5" id="xfP-Lr-W82"/>
<constraint firstItem="zCw-yW-TG3" firstAttribute="centerY" secondItem="s9v-lL-UoX" secondAttribute="centerY" id="zU5-3d-Vyv"/>
</constraints>
</tableViewCellContentView>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<connections>
<outlet property="itemIconImageView" destination="EHJ-P0-fGN" id="tkt-Jy-P8Z"/>
<outlet property="itemTitleLabel" destination="zCw-yW-TG3" id="z4V-Gq-mC4"/>
</connections>
</tableViewCell>
</prototypes>
<connections>
<outlet property="dataSource" destination="tfK-2z-1RF" id="5tB-Tt-cDN"/>
<outlet property="delegate" destination="tfK-2z-1RF" id="CmT-dR-cgP"/>
</connections>
</tableView>
<navigationItem key="navigationItem" id="vqg-kx-rYO"/>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="fSs-3q-Usg" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-11406" y="-4986"/>
</scene>
<!--Purchase Pro Version View Controller-->
<scene sceneID="7DV-6S-8ro">
<objects>
@@ -432,22 +303,6 @@ In più sostieni il progetto di ricerca il quale non riceve finanziamenti estern
</objects>
<point key="canvasLocation" x="-5085" y="-8358"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="P9F-yE-H1d">
<objects>
<navigationController id="eii-Cp-KHa" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="OoL-8C-jS9">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="tfK-2z-1RF" kind="relationship" relationship="rootViewController" id="SG6-Dd-3ic"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="kGG-XZ-SdW" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-12259" y="-4985"/>
</scene>
<!--Reti Sismi View Controller-->
<scene sceneID="eh7-nk-hxX">
<objects>
@@ -2528,8 +2383,8 @@ In più sostieni il progetto di ricerca il quale non riceve finanziamenti estern
<segue destination="Qva-UZ-dos" kind="relationship" relationship="viewControllers" id="Gut-Ub-oRh"/>
<segue destination="1d8-oR-UOQ" kind="relationship" relationship="viewControllers" id="8F0-ud-Dtb"/>
<segue destination="OV8-Cl-IaS" kind="presentation" identifier="ShowInitialLoading" modalPresentationStyle="fullScreen" modalTransitionStyle="coverVertical" id="Cmi-EJ-jD5"/>
<segue destination="1Ig-lx-PLm" kind="presentation" identifier="ShowSettings" modalPresentationStyle="fullScreen" id="GcE-Ki-D03"/>
<segue destination="noK-2F-IZE" kind="presentation" identifier="ShowLogs" id="nTq-XX-Uts"/>
<segue destination="1Ig-lx-PLm" kind="relationship" relationship="viewControllers" id="bBS-RW-R9T"/>
</connections>
</tabBarController>
<placeholder placeholderIdentifier="IBFirstResponder" id="JkD-5l-otE" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
@@ -2823,7 +2678,7 @@ In più sostieni il progetto di ricerca il quale non riceve finanziamenti estern
<!--Settings-->
<scene sceneID="nIl-RI-AZv">
<objects>
<tableViewController id="lfN-fJ-Rhu" customClass="SettingsViewController" sceneMemberID="viewController">
<tableViewController id="lfN-fJ-Rhu" customClass="SettingsViewController" customModule="Earthquake_Network" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="insetGrouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" id="w1e-nB-r5b">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -2833,13 +2688,7 @@ In più sostieni il progetto di ricerca il quale non riceve finanziamenti estern
<outlet property="delegate" destination="lfN-fJ-Rhu" id="0TK-rn-wet"/>
</connections>
</tableView>
<navigationItem key="navigationItem" title="Settings" id="4HJ-mw-8dz">
<barButtonItem key="rightBarButtonItem" style="done" systemItem="done" id="Evv-sz-Dkd">
<connections>
<action selector="closeTapped:" destination="lfN-fJ-Rhu" id="g3p-Bo-wXU"/>
</connections>
</barButtonItem>
</navigationItem>
<navigationItem key="navigationItem" title="Settings" id="4HJ-mw-8dz"/>
<connections>
<segue destination="oA9-rq-Kqp" kind="show" identifier="ShowAllertaSismica" id="PKv-wx-VXN"/>
<segue destination="jlJ-xb-75r" kind="show" identifier="ShowNotificheRetiSismiche" id="jjk-tO-OBj"/>
@@ -2848,7 +2697,7 @@ In più sostieni il progetto di ricerca il quale non riceve finanziamenti estern
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Lzh-6m-4x5" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-7973" y="-379"/>
<point key="canvasLocation" x="-7824" y="-2802"/>
</scene>
<!--Settings Seismic Networks View Controller-->
<scene sceneID="LVn-Sl-UM6">
@@ -2867,7 +2716,7 @@ In più sostieni il progetto di ricerca il quale non riceve finanziamenti estern
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Uvt-gu-Bum" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-5901" y="-360"/>
<point key="canvasLocation" x="-5753" y="-2783"/>
</scene>
<!--Settings Real Time Alerts View Controller-->
<scene sceneID="fj3-1O-nSI">
@@ -2886,7 +2735,7 @@ In più sostieni il progetto di ricerca il quale non riceve finanziamenti estern
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="z3g-sW-ZwB" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-6853" y="-1093"/>
<point key="canvasLocation" x="-6701" y="-3517"/>
</scene>
<!--Settings User Report Alerts View Controller-->
<scene sceneID="70o-xn-uI2">
@@ -2905,7 +2754,7 @@ In più sostieni il progetto di ricerca il quale non riceve finanziamenti estern
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="D0G-lo-3RH" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-6853" y="425"/>
<point key="canvasLocation" x="-6701" y="-1999"/>
</scene>
<!--Settings Seismic Network Alerts View Controller-->
<scene sceneID="44E-lc-Pfe">
@@ -2927,15 +2776,16 @@ In più sostieni il progetto di ricerca il quale non riceve finanziamenti estern
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Ycw-pT-hjt" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-6853" y="-360"/>
<point key="canvasLocation" x="-6701" y="-2783"/>
</scene>
<!--Navigation Controller-->
<!--Settings-->
<scene sceneID="bcf-1h-akt">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="1Ig-lx-PLm" sceneMemberID="viewController">
<tabBarItem key="tabBarItem" title="Settings" image="tabbar-icon-settings" id="5VO-yI-kw5"/>
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="B9g-HM-VPb">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" largeTitles="YES" id="B9g-HM-VPb">
<rect key="frame" x="0.0" y="0.0" width="320" height="91"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<nil name="viewControllers"/>
@@ -2945,7 +2795,7 @@ In più sostieni il progetto di ricerca il quale non riceve finanziamenti estern
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="We7-MM-5Sn" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-8856" y="-379"/>
<point key="canvasLocation" x="-8708" y="-2802"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="ugg-0S-WiU">
@@ -3201,7 +3051,6 @@ In più sostieni il progetto di ricerca il quale non riceve finanziamenti estern
</scene>
</scenes>
<resources>
<image name="eq_icon" width="166" height="166"/>
<image name="eq_icon_pro" width="166" height="166"/>
<image name="ic_arrow_drop_down_48px-128" width="128" height="128"/>
<image name="navbar-icon-filters" width="24" height="24"/>
@@ -3214,6 +3063,7 @@ In più sostieni il progetto di ricerca il quale non riceve finanziamenti estern
<image name="tabbar-icon-alerts" width="25" height="25"/>
<image name="tabbar-icon-networks" width="25" height="25"/>
<image name="tabbar-icon-reports" width="25" height="25"/>
<image name="tabbar-icon-settings" width="25" height="25"/>
<image name="top_100k" width="97.5" height="30"/>
<image name="top_10k" width="86" height="26.5"/>
<namedColor name="Light blue">
@@ -543,3 +543,4 @@
"aeo-GH-qCD.title" = "Alertas";
"oaL-SG-Zpq.title" = "Informes";
"eed-sY-0Ua.title" = "Redes Sísmicas";
"5VO-yI-kw5.title" = "Ajustes";
@@ -543,3 +543,4 @@
"aeo-GH-qCD.title" = "Allerte";
"oaL-SG-Zpq.title" = "Segnalazioni";
"eed-sY-0Ua.title" = "Reti Sismiche";
"5VO-yI-kw5.title" = "Impostazioni";
@@ -0,0 +1,22 @@
//
// AppTheme.swift
// Earthquake Network
//
// Created by Busi Andrea on 31/08/2020.
// Copyright © 2020 Earthquake Network. All rights reserved.
//
import Foundation
@objcMembers
class AppTheme: NSObject {
static let shared = AppTheme()
/// Color used for standard text
var textColor: UIColor = .black
/// Color used for text in a disabled component
var textDisabledColor: UIColor = .lightGray
/// Color used for label that contains value (ex. in settings page)
var valueColor: UIColor = .blue
}
@@ -11,7 +11,6 @@
#import "EQNSisma.h"
#import "Costanti.h"
#import "SWRevealViewController.h"
#import "CellDettagliMappaTableViewCell.h"
#import "Cell_Reti_sismicheTableViewCell.h"
#import "Cell_Meteo_TableViewCell.h"
@@ -13,7 +13,6 @@
#import "Costanti.h"
#import "ServerRequest.h"
#import "EQNGeneratoreURLServer.h"
#import "SWRevealViewController.h"
#import "EQNManager.h"
#import "EQNReteSmartphone.h"
#import "PastquakesDettagliMappa.h"
@@ -1,422 +0,0 @@
/*
Copyright (c) 2013 Joan Lluch <joan.lluch@sweetwilliamsl.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Early code inspired on a similar class by Philip Kluz (Philip.Kluz@zuui.org)
*/
/*
RELEASE NOTES
Version 2.4.0 (Current Version)
- Updated behaviour of appearance method calls on child controllers
- Removes Xcode 6.3.1 warnings
Version 2.3.0
- StoryBoard initializing bug fix
- Minor Code refactoring
Version 2.2.0
- State Restoration support.
- Reverted panGestureRecognizer implementation to before v2.1.0 (works better).
- New properties 'toggleAnimationType', 'springDampingRatio'. Default reveal animation is 'Spring'
- New property 'frontViewShadowColor'
- New properties 'clipsViewsToBounds' and '_extendedPointInsideHit'
- New delegate methods for finer control of front view location in the overdraw area, as long as deprecation note on former delegate methods
- Other minor changes that should not affect current implementations
Version 2.1.0
- Removed SWDirectionPanGestureRecognizer. Horizontal panning is filtered on the shouldBegin delegate. This is cleaner, I hope it does not break previous funcionality
- Took a cleaner approach to storyboard support. SWRevealViewControllerSegue is now deprecated and you should use SWRevealViewControllerSegueSetController and SWRevealViewControllerSeguePushController instead.
- A minor change on the autoresizingMask of the internal views to fix a glitch on iOS8. This should not affect iOS7
Version 2.0.2
- Added new delegates for better control of gesture recognizers
Version 2.0.1
- Fix: draggableBorderWidth now correctly handles the cases where one of the rear controllers is not provided
- Fix: the shadow related properties are now granted at any time after view load, not just after initialization.
Version 2.0.0
- Dropped support for iOS6 and earlier. This version will only work on iOS7
- The method setFrontViewController:animated: does not longer perform a full reveal animation. Instead it just replaces the frontViewController in
its current position. Use the new pushFrontViewController:animated: method to perform a replacement of the front controlles with reveal animation
as in the previous version
IMPORTANT: You must replace all calls to setFrontViewController:animated by calls to pushFrontViewController:animated to prevent breaking
functionality on existing projects.
- Added support for animated replacement of child controllers: setRearViewController, setFrontViewController, setRightViewController now have animated versions.
- The new 'replaceViewAnimationDuration' property sets the default duration of child viewController replacement.
- Added the following new delegate methods
revealController:willAddViewController:forOperation:animated:
revealController:didAddViewController:forOperation:animated:
- The class also supports custom UIViewControllerAnimatedTransitioning related with the replacement of child viewControllers.
You can implement the following new delegate method: revealController:animationControllerForOperation:fromViewController:toViewController:
and provide an object conforming to UIViewControllerAnimatedTransitioning to implement custom animations.
Version 1.1.3
- Reverted the supportedInterfaceOrientations to the default behavior. This is consistent with Apple provided controllers
- The presentFrontViewHierarchically now dynamically takes into account the smaller header height of bars on iPhone landscape orientation
Version 1.1.2
- The status bar style and appearance are now handled in sync with the class animations.
You can implement the methods preferredStatusBarStyle and prefersStatusBarHidden on your child controllers to define the desired appearance
- The loadView method now calls a method, loadStoryboardControllers, just for the purpose of loading child controllers from a storyboard.
You can override this method and remove the @try @catch statements if you want the debugger not to stop at them in case you have set an exception breakpoint.
Version 1.1.1
- You can now get a tapGestureRecognizer from the class. See the tapGestureRecognizer method for more information.
- Both the panGestureRecognizer and the tapGestureRecognizer are now attached to the revealViewController's front content view
by default, so they will start working just by calling their access methods even if you do not attach them to any of your views.
This enables you to dissable interactions on your views -for example based on position- without breaking normal gesture behavior.
- Corrected a bug that caused a crash on iOS6 and earlier.
Version 1.1.0
- The method setFrontViewController:animated now performs the correct animations both for left and right controllers.
- The class now automatically handles the status bar appearance depending on the currently shown child controller.
Version 1.0.8
- Support for constant width frontView by setting a negative value to reveal widths. See properties rearViewRevealWidth and rightViewRevealWidth
- Support for draggableBorderWidth. See property of the same name.
- The Pan gesture recongnizer can be disabled by implementing the following delegate method and returning NO
revealControllerPanGestureShouldBegin:
- Added the ability to track pan gesture reveal progress through the following new delegate methods
revealController:panGestureBeganFromLocation:progress:
revealController:panGestureMovedToLocation:progress:
revealController:panGestureEndedToLocation:progress:
Previous Versions
- No release notes were updated for previous versions.
*/
#import <UIKit/UIKit.h>
@class SWRevealViewController;
@protocol SWRevealViewControllerDelegate;
#pragma mark - SWRevealViewController Class
// Enum values for setFrontViewPosition:animated:
typedef NS_ENUM( NSInteger, FrontViewPosition)
{
// Front controller is removed from view. Animated transitioning from this state will cause the same
// effect than animating from FrontViewPositionLeftSideMost. Use this instead of FrontViewPositionLeftSideMost when
// you want to remove the front view controller view from the view hierarchy.
FrontViewPositionLeftSideMostRemoved,
// Left most position, front view is presented left-offseted by rightViewRevealWidth+rigthViewRevealOverdraw
FrontViewPositionLeftSideMost,
// Left position, front view is presented left-offseted by rightViewRevealWidth
FrontViewPositionLeftSide,
// Center position, rear view is hidden behind front controller
FrontViewPositionLeft,
// Right possition, front view is presented right-offseted by rearViewRevealWidth
FrontViewPositionRight,
// Right most possition, front view is presented right-offseted by rearViewRevealWidth+rearViewRevealOverdraw
FrontViewPositionRightMost,
// Front controller is removed from view. Animated transitioning from this state will cause the same
// effect than animating from FrontViewPositionRightMost. Use this instead of FrontViewPositionRightMost when
// you intent to remove the front controller view from the view hierarchy.
FrontViewPositionRightMostRemoved,
};
// Enum values for toggleAnimationType
typedef NS_ENUM(NSInteger, SWRevealToggleAnimationType)
{
SWRevealToggleAnimationTypeSpring, // <- produces a spring based animation
SWRevealToggleAnimationTypeEaseOut, // <- produces an ease out curve animation
};
@interface SWRevealViewController : UIViewController
/* Basic API */
// Object instance init and rear view setting
- (id)initWithRearViewController:(UIViewController *)rearViewController frontViewController:(UIViewController *)frontViewController;
// Rear view controller, can be nil if not used
@property (nonatomic) UIViewController *rearViewController;
- (void)setRearViewController:(UIViewController *)rearViewController animated:(BOOL)animated;
// Optional right view controller, can be nil if not used
@property (nonatomic) UIViewController *rightViewController;
- (void)setRightViewController:(UIViewController *)rightViewController animated:(BOOL)animated;
// Front view controller, can be nil on initialization but must be supplied by the time the view is loaded
@property (nonatomic) UIViewController *frontViewController;
- (void)setFrontViewController:(UIViewController *)frontViewController animated:(BOOL)animated;
// Sets the frontViewController using a default set of chained animations consisting on moving the
// presented frontViewController to the right most possition, replacing it, and moving it back to the left position
- (void)pushFrontViewController:(UIViewController *)frontViewController animated:(BOOL)animated;
// Sets the frontViewController position. You can call the animated version several times with different
// positions to obtain a set of animations that will be performed in order one after the other.
@property (nonatomic) FrontViewPosition frontViewPosition;
- (void)setFrontViewPosition:(FrontViewPosition)frontViewPosition animated:(BOOL)animated;
// The following methods are meant to be directly connected to the action method of a button
// to perform user triggered postion change of the controller views. This is ussually added to a
// button on top left or right of the frontViewController
- (IBAction)revealToggle:(id)sender;
- (IBAction)rightRevealToggle:(id)sender; // <-- simetric implementation of the above for the rightViewController
// Toogles the current state of the front controller between Left or Right and fully visible
// Use setFrontViewPosition to set a particular position
- (void)revealToggleAnimated:(BOOL)animated;
- (void)rightRevealToggleAnimated:(BOOL)animated; // <-- simetric implementation of the above for the rightViewController
// The following method will provide a panGestureRecognizer suitable to be added to any view
// in order to perform usual drag and swipe gestures to reveal the rear views. This is usually added to the top bar
// of a front controller, but it can be added to your frontViewController view or to the reveal controller view to provide full screen panning.
// By default, the panGestureRecognizer is added to the view containing the front controller view. To keep this default behavior
// you still need to call this method, just don't add it to any of your views. The default setup allows you to dissable
// user interactions on your controller views without affecting the recognizer.
- (UIPanGestureRecognizer*)panGestureRecognizer;
// The following method will provide a tapGestureRecognizer suitable to be added to any view on the frontController
// for concealing the rear views. By default no tap recognizer is created or added to any view, however if you call this method after
// the controller's view has been loaded the recognizer is added to the reveal controller's front container view.
// Thus, you can disable user interactions on your frontViewController view without affecting the tap recognizer.
- (UITapGestureRecognizer*)tapGestureRecognizer;
/* The following properties are provided for further customization, they are set to default values on initialization,
you do not generally have to set them */
// Defines how much of the rear or right view is shown, default is 260.
// Negative values indicate that the reveal width should be computed by substracting the full front view width,
// so the revealed frontView width is kept constant when bounds change as opposed to the rear or right width.
@property (nonatomic) CGFloat rearViewRevealWidth;
@property (nonatomic) CGFloat rightViewRevealWidth; // <-- simetric implementation of the above for the rightViewController
// Defines how much of an overdraw can occur when dragging further than 'rearViewRevealWidth', default is 60.
@property (nonatomic) CGFloat rearViewRevealOverdraw;
@property (nonatomic) CGFloat rightViewRevealOverdraw; // <-- simetric implementation of the above for the rightViewController
// Defines how much displacement is applied to the rear view when animating or dragging the front view, default is 40.
@property (nonatomic) CGFloat rearViewRevealDisplacement;
@property (nonatomic) CGFloat rightViewRevealDisplacement; // <-- simetric implementation of the above for the rightViewController
// Defines a width on the border of the view attached to the panGesturRecognizer where the gesture is allowed,
// default is 0 which means no restriction.
@property (nonatomic) CGFloat draggableBorderWidth;
// If YES (the default) the controller will bounce to the Left position when dragging further than 'rearViewRevealWidth'
@property (nonatomic) BOOL bounceBackOnOverdraw;
@property (nonatomic) BOOL bounceBackOnLeftOverdraw; // <-- simetric implementation of the above for the rightViewController
// If YES (default is NO) the controller will allow permanent dragging up to the rightMostPosition
@property (nonatomic) BOOL stableDragOnOverdraw;
@property (nonatomic) BOOL stableDragOnLeftOverdraw; // <-- simetric implementation of the above for the rightViewController
// If YES (default is NO) the front view controller will be ofsseted vertically by the height of a navigation bar.
// Use this on iOS7 when you add an instance of RevealViewController as a child of a UINavigationController (or another SWRevealViewController)
// and you want the front view controller to be presented below the navigation bar of its UINavigationController grand parent.
// The rearViewController will still appear full size and blurred behind the navigation bar of its UINavigationController grand parent
@property (nonatomic) BOOL presentFrontViewHierarchically;
// Velocity required for the controller to toggle its state based on a swipe movement, default is 250
@property (nonatomic) CGFloat quickFlickVelocity;
// Duration for the revealToggle animation, default is 0.25
@property (nonatomic) NSTimeInterval toggleAnimationDuration;
// Animation type, default is SWRevealToggleAnimationTypeSpring
@property (nonatomic) SWRevealToggleAnimationType toggleAnimationType;
// When animation type is SWRevealToggleAnimationTypeSpring determines the damping ratio, default is 1
@property (nonatomic) CGFloat springDampingRatio;
// Duration for animated replacement of view controllers
@property (nonatomic) NSTimeInterval replaceViewAnimationDuration;
// Defines the radius of the front view's shadow, default is 2.5f
@property (nonatomic) CGFloat frontViewShadowRadius;
// Defines the radius of the front view's shadow offset default is {0.0f,2.5f}
@property (nonatomic) CGSize frontViewShadowOffset;
// Defines the front view's shadow opacity, default is 1.0f
@property (nonatomic) CGFloat frontViewShadowOpacity;
// Defines the front view's shadow color, default is blackColor
@property (nonatomic) UIColor *frontViewShadowColor;
// Defines whether the controller should clip subviews to its view bounds. Default is NO.
// Set this to YES when you are presenting this controller as a non full-screen child of a
// custom container controller which does not explicitly clips its subviews.
@property (nonatomic) BOOL clipsViewsToBounds;
// Defines whether your views clicable area extends beyond the bounds of this controller. Default is NO.
// Set this to YES if you are presenting this controller as a non full-screen child of a custom container and you are not
// clipping your front view to this controller bounds.
@property (nonatomic) BOOL extendsPointInsideHit;
/* The class properly handles all the relevant calls to appearance methods on the contained controllers.
Moreover you can assign a delegate to let the class inform you on positions and animation activity */
// Delegate
@property (nonatomic,weak) id<SWRevealViewControllerDelegate> delegate;
@end
#pragma mark - SWRevealViewControllerDelegate Protocol
typedef enum
{
SWRevealControllerOperationNone,
SWRevealControllerOperationReplaceRearController,
SWRevealControllerOperationReplaceFrontController,
SWRevealControllerOperationReplaceRightController,
} SWRevealControllerOperation;
@protocol SWRevealViewControllerDelegate<NSObject>
@optional
// The following delegate methods will be called before and after the front view moves to a position
- (void)revealController:(SWRevealViewController *)revealController willMoveToPosition:(FrontViewPosition)position;
- (void)revealController:(SWRevealViewController *)revealController didMoveToPosition:(FrontViewPosition)position;
// This will be called inside the reveal animation, thus you can use it to place your own code that will be animated in sync
- (void)revealController:(SWRevealViewController *)revealController animateToPosition:(FrontViewPosition)position;
// Implement this to return NO when you want the pan gesture recognizer to be ignored
- (BOOL)revealControllerPanGestureShouldBegin:(SWRevealViewController *)revealController;
// Implement this to return NO when you want the tap gesture recognizer to be ignored
- (BOOL)revealControllerTapGestureShouldBegin:(SWRevealViewController *)revealController;
// Implement this to return YES if you want other gesture recognizer to share touch events with the pan gesture
- (BOOL)revealController:(SWRevealViewController *)revealController
panGestureRecognizerShouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer;
// Implement this to return YES if you want other gesture recognizer to share touch events with the tap gesture
- (BOOL)revealController:(SWRevealViewController *)revealController
tapGestureRecognizerShouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer;
// Called when the gestureRecognizer began and ended
- (void)revealControllerPanGestureBegan:(SWRevealViewController *)revealController;
- (void)revealControllerPanGestureEnded:(SWRevealViewController *)revealController;
// The following methods provide a means to track the evolution of the gesture recognizer.
// The 'location' parameter is the X origin coordinate of the front view as the user drags it
// The 'progress' parameter is a number ranging from 0 to 1 indicating the front view location relative to the
// rearRevealWidth or rightRevealWidth. 1 is fully revealed, dragging ocurring in the overDraw region will result in values above 1.
// The 'overProgress' parameter is a number ranging from 0 to 1 indicating the front view location relative to the
// overdraw region. 0 is fully revealed, 1 is fully overdrawn. Negative values occur inside the normal reveal region
- (void)revealController:(SWRevealViewController *)revealController panGestureBeganFromLocation:(CGFloat)location progress:(CGFloat)progress overProgress:(CGFloat)overProgress;
- (void)revealController:(SWRevealViewController *)revealController panGestureMovedToLocation:(CGFloat)location progress:(CGFloat)progress overProgress:(CGFloat)overProgress;
- (void)revealController:(SWRevealViewController *)revealController panGestureEndedToLocation:(CGFloat)location progress:(CGFloat)progress overProgress:(CGFloat)overProgress;
// Notification of child controller replacement
- (void)revealController:(SWRevealViewController *)revealController willAddViewController:(UIViewController *)viewController
forOperation:(SWRevealControllerOperation)operation animated:(BOOL)animated;
- (void)revealController:(SWRevealViewController *)revealController didAddViewController:(UIViewController *)viewController
forOperation:(SWRevealControllerOperation)operation animated:(BOOL)animated;
// Support for custom transition animations while replacing child controllers. If implemented, it will be fired in response
// to calls to 'setXXViewController' methods
- (id<UIViewControllerAnimatedTransitioning>)revealController:(SWRevealViewController *)revealController
animationControllerForOperation:(SWRevealControllerOperation)operation fromViewController:(UIViewController *)fromVC toViewController:(UIViewController *)toVC;
// DEPRECATED - The following delegate methods will be removed some time in the future
- (void)revealController:(SWRevealViewController *)revealController panGestureBeganFromLocation:(CGFloat)location progress:(CGFloat)progress; // (DEPRECATED)
- (void)revealController:(SWRevealViewController *)revealController panGestureMovedToLocation:(CGFloat)location progress:(CGFloat)progress; // (DEPRECATED)
- (void)revealController:(SWRevealViewController *)revealController panGestureEndedToLocation:(CGFloat)location progress:(CGFloat)progress; // (DEPRECATED)
@end
#pragma mark - UIViewController(SWRevealViewController) Category
// A category of UIViewController to let childViewControllers easily access their parent SWRevealViewController
@interface UIViewController(SWRevealViewController)
- (SWRevealViewController*)revealViewController;
@end
#pragma mark - StoryBoard support Classes
/* StoryBoard support */
// String identifiers to be applied to segues on a storyboard
extern NSString* const SWSegueRearIdentifier; // this is @"sw_rear"
extern NSString* const SWSegueFrontIdentifier; // this is @"sw_front"
extern NSString* const SWSegueRightIdentifier; // this is @"sw_right"
/* This will allow the class to be defined on a storyboard */
// Use this along with one of the above segue identifiers to segue to the initial state
@interface SWRevealViewControllerSegueSetController : UIStoryboardSegue
@end
// Use this to push a view controller
@interface SWRevealViewControllerSeguePushController : UIStoryboardSegue
@end
//#pragma mark - SWRevealViewControllerSegue (DEPRECATED)
//
//@interface SWRevealViewControllerSegue : UIStoryboardSegue // DEPRECATED: USE SWRevealViewControllerSegueSetController instead
//@property (nonatomic, strong) void(^performBlock)( SWRevealViewControllerSegue* segue, UIViewController* svc, UIViewController* dvc );
//@end
File diff suppressed because it is too large Load Diff
@@ -13,7 +13,6 @@
#import "EQNUser.h"
#import "EQNGeneratoreURLServer.h"
#import "EQNUtility.h"
#import "SWRevealViewController.h"
@interface SegnalazioniViewController () <UITableViewDelegate, UITableViewDataSource>
@@ -1,15 +1,4 @@
/*
InfoPlist.strings
Earthquake Network
Created by Luca Beretta on 08/05/2019.
Copyright © 2019 Luca Beretta. All rights reserved.
*/
"NSLocationAlwaysAndWhenInUseUsageDescription" = "We need your location to send you real time seismic alerts";
"NSLocationAlwaysUsageDescription" = "We need your location to send you real time seismic alerts";
"NSLocationWhenInUseUsageDescription" = "We need your location to send you real time seismic alerts";
"NSLocationAlwaysAndWhenInUseUsageDescription" = "Change to 'Always allow' so we can alert you in real time when an earthquake occurs nearby.";
"NSLocationAlwaysUsageDescription" = "Change to 'Always allow' so we can alert you in real time when an earthquake occurs nearby.";
"NSLocationWhenInUseUsageDescription" = "We need your location to send you real time seismic alerts.";
"CFBundleDisplayName" = "Earthquake Network";
@@ -379,7 +379,7 @@
"Notifica anche sismi per i quali non è possibile stimare l'intensità" = "Also notifies earthquakes for which it is not possible to estimate the intensity";
/* voce menu */
"Notifica sismi di qualsiasi magnitudo se la distanza è inferiore a" = "Notify earthquakes of any magnitude if the distance is less than";
"Notifica sismi di qualsiasi magnitudo se la distanza è inferiore a 50 km" = "Notify earthquakes of any magnitude if the distance is less than 50 km";
/* voce menu */
"Notifica sismi forti a qualsiasi distanza se la magnitudo è maggiore a" = "Notify strong earthquakes at any distance if the magnitude is greater than";
@@ -477,7 +477,7 @@
"Raggio dalla tua posizione" = "Radius from your location";
/* voce menu */
"Raggio sismi forti o intensità non disponibile" = "Radius strong earthquakes or intensity not available";
"Raggio sismi forti" = "Radius strong earthquakes";
/* voce menu */
"Raggio sismi lievi" = "Radius mild earthquakes";
@@ -1,15 +1,4 @@
/*
InfoPlist.strings
Earthquake Network
Created by Luca Beretta on 08/05/2019.
Copyright © 2019 Luca Beretta. All rights reserved.
*/
"NSLocationAlwaysAndWhenInUseUsageDescription" = "Necesitamos tu ubicación para enviarte alertas sísmicas en tiempo real";
"NSLocationAlwaysUsageDescription" = "Necesitamos tu ubicación para enviarte alertas sísmicas en tiempo real";
"NSLocationAlwaysAndWhenInUseUsageDescription" = "Cambiar a 'Permitir siempre' para que podamos alertarte en tiempo real cuando se produce un sismo cercano.";
"NSLocationAlwaysUsageDescription" = "Cambiar a 'Permitir siempre' para que podamos alertarte en tiempo real cuando se produce un sismo cercano.";
"NSLocationWhenInUseUsageDescription" = "Necesitamos tu ubicación para enviarte alertas sísmicas en tiempo real";
"CFBundleDisplayName" = "Sismos Detector";
@@ -374,7 +374,7 @@
"Notifica anche sismi per i quali non è possibile stimare l'intensità" = "También notifica sismos para los que no es posible estimar la intensidad.";
/* voce menu */
"Notifica sismi di qualsiasi magnitudo se la distanza è inferiore a" = "Notificar sismos de cualquier magnitud si la distancia es inferior a";
"Notifica sismi di qualsiasi magnitudo se la distanza è inferiore a 50 km" = "Notificar sismos de cualquier magnitud si la distancia es inferior a 50 km";
/* voce menu */
"Notifica sismi forti a qualsiasi distanza se la magnitudo è maggiore a" = "Notificar sismos fuertes a cualquier distancia si la magnitud es mayor que";
@@ -472,7 +472,7 @@
"Raggio dalla tua posizione" = "Radio desde tu ubicación";
/* voce menu */
"Raggio sismi forti o intensità non disponibile" = "Radio sismos fuertes o con intensidad no disponible";
"Raggio sismi forti" = "Radio sismos fuertes";
/* voce menu */
"Raggio sismi lievi" = "Radio sismos leves";
@@ -1,16 +1,4 @@
/*
InfoPlist.strings
Earthquake Network
Created by Luca Beretta on 08/05/2019.
Copyright © 2019 Luca Beretta. All rights reserved.
*/
"NSLocationAlwaysAndWhenInUseUsageDescription" = "La tua posizione è necessaria per ricevere le allerte sismiche in tempo reale";
"NSLocationAlwaysUsageDescription" = "La tua posizione è necessaria per ricevere le allerte sismiche in tempo reale";
"NSLocationWhenInUseUsageDescription" = "La tua posizione è necessaria per ricevere le allerte sismiche in tempo reale";
"NSLocationAlwaysAndWhenInUseUsageDescription" = "Passa a 'Consenti sempre' in modo che possiamo allertarti in tempo reale quando accade un sisma nelle tue vicinanze.";
"NSLocationAlwaysUsageDescription" = "Passa a 'Consenti sempre' in modo che possiamo allertarti in tempo reale quando accade un sisma nelle tue vicinanze.";
"NSLocationWhenInUseUsageDescription" = "La tua posizione è necessaria per ricevere le allerte sismiche in tempo reale.";
"CFBundleDisplayName" = "Rilevatore Terremoto";
@@ -372,7 +372,7 @@
"Notifica anche sismi per i quali non è possibile stimare l'intensità" = "Notifica anche sismi per i quali non è possibile stimare l\'intensità";
/* voce menu */
"Notifica sismi di qualsiasi magnitudo se la distanza è inferiore a" = "Notifica sismi di qualsiasi magnitudo se la distanza è inferiore a";
"Notifica sismi di qualsiasi magnitudo se la distanza è inferiore a 50 km" = "Notifica sismi di qualsiasi magnitudo se la distanza è inferiore a 50 km";
/* voce menu */
"Notifica sismi forti a qualsiasi distanza se la magnitudo è maggiore a" = "Notifica sismi forti a qualsiasi distanza se la magnitudo è maggiore a";
@@ -470,7 +470,7 @@
"Raggio dalla tua posizione" = "Raggio dalla tua posizione";
/* voce menu */
"Raggio sismi forti o intensità non disponibile" = "Raggio sismi forti o intensità non disponibile";
"Raggio sismi forti" = "Raggio sismi forti";
/* voce menu */
"Raggio sismi lievi" = "Raggio sismi lievi";
@@ -26,9 +26,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, strong) NSArray *listaMessaggi;
@property (nonatomic, strong) NSArray *listaAreeInteresse;
+(EQNAllertaSismica *)center;
-(void)saveUserInfo;
-(void)removeUser;
+ (instancetype)center;
- (void)saveUserInfo;
@end
@@ -8,40 +8,47 @@
#import "EQNAllertaSismica.h"
#import "Costanti.h"
@implementation EQNAllertaSismica
+(EQNAllertaSismica *)center{
#pragma mark - Singleton
+ (instancetype)center
{
static EQNAllertaSismica *instance = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
instance = [[self alloc]init];
[instance initSingleton];
instance = [[self alloc] init];
});
return instance;
}
-(void)initSingleton{
self.isAbilitato = [[NSUserDefaults standardUserDefaults] boolForKey:NOTIFICHE_ALLERA_SISMICA_ABILITATO];
self.isSimiSenzaIntensita = [[NSUserDefaults standardUserDefaults] boolForKey:NOTIFICHE_ALLERA_SISMICA_SENZA_INTENSITA];
self.sismiDaNotificare = [[NSUserDefaults standardUserDefaults] objectForKey:NOTIFICHE_ALLERA_SISMICA_SISMI_DA_NOTIFICARE];
self.raggioSismiLievi = [[NSUserDefaults standardUserDefaults] objectForKey:NOTIFICHE_ALLERA_SISMICA_RAGGIO_SISMI_LIEVI];
self.tonoAllarme = [[NSUserDefaults standardUserDefaults] objectForKey:NOTIFICHE_ALLERA_SISMICA_TONO_ALLARME];
if (!self.tonoAllarme)
self.tonoAllarme = @"alert_star_trek.wav";
self.isintervalloAllarme = [[NSUserDefaults standardUserDefaults] boolForKey:NOTIFICHE_ALLERA_SISMICA_ABILITA_INTERVALLO];
self.oraioInizio = [[NSUserDefaults standardUserDefaults] objectForKey:NOTIFICHE_ALLERA_SISMICA_ORA_INIZIO];
self.orarioFine = [[NSUserDefaults standardUserDefaults] objectForKey:NOTIFICHE_ALLERA_SISMICA_ORA_FINE];
#pragma mark - Init
- (instancetype)init
{
self = [super init];
if (self) {
self.isAbilitato = [[NSUserDefaults standardUserDefaults] boolForKey:NOTIFICHE_ALLERA_SISMICA_ABILITATO];
self.isSimiSenzaIntensita = NO; // parametro rimosso dalle impostazioni, manteniamo l'invio al server come false
self.sismiDaNotificare = [[NSUserDefaults standardUserDefaults] objectForKey:NOTIFICHE_ALLERA_SISMICA_SISMI_DA_NOTIFICARE];
self.raggioSismiLievi = [[NSUserDefaults standardUserDefaults] objectForKey:NOTIFICHE_ALLERA_SISMICA_RAGGIO_SISMI_LIEVI];
self.tonoAllarme = [[NSUserDefaults standardUserDefaults] objectForKey:NOTIFICHE_ALLERA_SISMICA_TONO_ALLARME];
if (!self.tonoAllarme) {
self.tonoAllarme = @"alert_star_trek.wav";
}
self.isintervalloAllarme = [[NSUserDefaults standardUserDefaults] boolForKey:NOTIFICHE_ALLERA_SISMICA_ABILITA_INTERVALLO];
self.oraioInizio = [[NSUserDefaults standardUserDefaults] objectForKey:NOTIFICHE_ALLERA_SISMICA_ORA_INIZIO];
self.orarioFine = [[NSUserDefaults standardUserDefaults] objectForKey:NOTIFICHE_ALLERA_SISMICA_ORA_FINE];
}
return self;
}
-(void)saveUserInfo{
[[NSUserDefaults standardUserDefaults] setBool:self.isAbilitato forKey:NOTIFICHE_ABILITATO_TSUNAMI];
[[NSUserDefaults standardUserDefaults] setBool:self.isSimiSenzaIntensita forKey:NOTIFICHE_ALLERA_SISMICA_SENZA_INTENSITA];
#pragma mark - Public
- (void)saveUserInfo
{
[[NSUserDefaults standardUserDefaults] setBool:self.isAbilitato forKey:NOTIFICHE_ALLERA_SISMICA_ABILITATO];
[[NSUserDefaults standardUserDefaults] setObject:self.sismiDaNotificare forKey:NOTIFICHE_ALLERA_SISMICA_SISMI_DA_NOTIFICARE];
[[NSUserDefaults standardUserDefaults] setObject:self.raggioSismiLievi forKey:NOTIFICHE_ALLERA_SISMICA_RAGGIO_SISMI_LIEVI];
[[NSUserDefaults standardUserDefaults] setObject:self.tonoAllarme forKey:NOTIFICHE_ALLERA_SISMICA_TONO_ALLARME];
@@ -49,14 +56,6 @@
[[NSUserDefaults standardUserDefaults] setObject:self.oraioInizio forKey:NOTIFICHE_ALLERA_SISMICA_ORA_INIZIO];
[[NSUserDefaults standardUserDefaults] setObject:self.orarioFine forKey:NOTIFICHE_ALLERA_SISMICA_ORA_FINE];
[[NSUserDefaults standardUserDefaults] synchronize];
}
-(void)removeUser{
}
@end
@@ -32,7 +32,7 @@
self.energiaSisma = [[NSUserDefaults standardUserDefaults] objectForKey:NOTIFICHE_ATTIVA_RETI_ENERGIA_SISMI];
self.distanzaVicini = [[NSUserDefaults standardUserDefaults] objectForKey:NOTIFICHE_ATTIVA_RETI_DISTANZA_VICINI];
self.distanzaVicini = @"50"; // parametro rimosso dalle impostazioni, valore fisso inviato al server
self.energiaTerremotiForti = [[NSUserDefaults standardUserDefaults] objectForKey:NOTIFICHE_ATTIVA_RETI_ENERGIA_FORTI];
@@ -47,8 +47,6 @@
[[NSUserDefaults standardUserDefaults] setObject:self.energiaSisma forKey:NOTIFICHE_ATTIVA_RETI_ENERGIA_SISMI];
[[NSUserDefaults standardUserDefaults] setObject:self.distanzaVicini forKey:NOTIFICHE_ATTIVA_RETI_DISTANZA_VICINI];
[[NSUserDefaults standardUserDefaults] setObject:self.energiaTerremotiForti forKey:NOTIFICHE_ATTIVA_RETI_ENERGIA_FORTI];
[[NSUserDefaults standardUserDefaults] setBool:self.isAbilitato forKey:NOTIFICHE_ATTIVA_RETI_SISMICHE];