├── .gitignore ├── .swiftlint.yml ├── Covid.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcshareddata │ └── xcschemes │ └── Covid.xcscheme ├── Covid.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── Covid ├── AdditionalInfo │ ├── AboutViewController.swift │ ├── Covid-Bridging-Header.h │ ├── Hashids.swift │ ├── IdentityViewController.swift │ ├── PreventionTableViewCell.swift │ ├── PreventionViewController.swift │ ├── SymptomsViewController.swift │ ├── hashids.c │ └── hashids.h ├── AppDelegate.swift ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Covid.entitlements ├── Extensions │ ├── CLLocationCoordinate2D.swift │ ├── DateExtensions.swift │ ├── General.swift │ ├── NotificationCenterObserver.swift │ ├── UINavigationBar+Transparent.swift │ └── UIStoryBoard.swift ├── MainScreen │ ├── ForeignDecisionViewController.swift │ ├── MainViewController.swift │ ├── QuarantineViewController.swift │ └── StatsViewController.swift ├── Map │ ├── SpreadListTableViewController.swift │ ├── SpreadMapViewController.swift │ └── SpreadViewController.swift ├── PrivacyViewController.swift ├── Quarantine │ ├── AddressConfirmationViewController.swift │ ├── ChooseDateViewController.swift │ ├── CountryCodeViewController.swift │ ├── FaceID │ │ ├── FaceCaptureCompletedViewController.swift │ │ ├── FaceCaptureCoordinator.swift │ │ ├── FaceCaptureOnboardingViewController.swift │ │ ├── FaceIDNotification.swift │ │ ├── FaceIDUseCase.swift │ │ └── FaceIDVerification.swift │ ├── MapViewController.swift │ ├── SearchMapViewController.swift │ ├── SelectAddressInfoViewController.swift │ └── VerificationCodeViewController.swift ├── Resources │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ └── ItunesArtwork@2x.png │ │ ├── CE.imageset │ │ │ ├── CE.png │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── DOC-character.imageset │ │ │ ├── Contents.json │ │ │ └── DOC-character.pdf │ │ ├── ID-character.imageset │ │ │ ├── Contents.json │ │ │ └── ID-character.pdf │ │ ├── ID.imageset │ │ │ ├── Contents.json │ │ │ └── ID.pdf │ │ ├── Prevention │ │ │ ├── Contents.json │ │ │ ├── prevention01.imageset │ │ │ │ ├── 01.pdf │ │ │ │ └── Contents.json │ │ │ ├── prevention02.imageset │ │ │ │ ├── 02.pdf │ │ │ │ └── Contents.json │ │ │ ├── prevention03.imageset │ │ │ │ ├── 03.pdf │ │ │ │ └── Contents.json │ │ │ ├── prevention04.imageset │ │ │ │ ├── 04.pdf │ │ │ │ └── Contents.json │ │ │ ├── prevention05.imageset │ │ │ │ ├── 05.pdf │ │ │ │ └── Contents.json │ │ │ ├── prevention06.imageset │ │ │ │ ├── 06.pdf │ │ │ │ └── Contents.json │ │ │ └── prevention07.imageset │ │ │ │ ├── 07.pdf │ │ │ │ └── Contents.json │ │ ├── ZZ-logo.imageset │ │ │ ├── Contents.json │ │ │ └── ZZ-logo.pdf │ │ ├── about-app-icon.imageset │ │ │ ├── Contents.json │ │ │ └── about-app-icon.pdf │ │ ├── arrow.imageset │ │ │ ├── Contents.json │ │ │ └── arrow.pdf │ │ ├── edit-icon.imageset │ │ │ ├── Contents.json │ │ │ └── edit-icon.pdf │ │ ├── home.imageset │ │ │ ├── Contents.json │ │ │ └── home.pdf │ │ ├── howtoprotect.imageset │ │ │ ├── Contents.json │ │ │ └── howtoprotect.pdf │ │ ├── ic_check-green.imageset │ │ │ ├── Contents.json │ │ │ └── ic_check-green.pdf │ │ ├── ic_check-grey.imageset │ │ │ ├── Contents.json │ │ │ └── ic_check-grey (1).pdf │ │ ├── ic_check-red.imageset │ │ │ ├── Contents.json │ │ │ └── ic_check-grey (2).pdf │ │ ├── ic_faceid-logo.imageset │ │ │ ├── Contents.json │ │ │ └── ic_faceid-logo (1).pdf │ │ ├── info-icon.imageset │ │ │ ├── Contents.json │ │ │ └── info-icon.pdf │ │ ├── map-icon.imageset │ │ │ ├── Contents.json │ │ │ └── map-icon.pdf │ │ ├── mzsr.imageset │ │ │ ├── Contents.json │ │ │ └── mzsr.png │ │ ├── nczi.imageset │ │ │ ├── Contents.json │ │ │ └── nczi-logo.png │ │ ├── pin-select-location.imageset │ │ │ ├── Contents.json │ │ │ └── pin-select-location.pdf │ │ ├── pin.imageset │ │ │ ├── Contents.json │ │ │ └── pin2.pdf │ │ ├── send-data.imageset │ │ │ ├── Contents.json │ │ │ └── send-data.pdf │ │ ├── slide-map.imageset │ │ │ ├── Contents.json │ │ │ └── slide.pdf │ │ └── symptomes.imageset │ │ │ ├── Contents.json │ │ │ └── symptomes.pdf │ ├── CountryCodes.json │ ├── Fonts │ │ ├── interUI │ │ │ ├── Inter-Black.otf │ │ │ ├── Inter-BlackItalic.otf │ │ │ ├── Inter-Bold.otf │ │ │ ├── Inter-BoldItalic.otf │ │ │ ├── Inter-ExtraBold.otf │ │ │ ├── Inter-ExtraBoldItalic.otf │ │ │ ├── Inter-ExtraLight.otf │ │ │ ├── Inter-ExtraLightItalic.otf │ │ │ ├── Inter-Italic.otf │ │ │ ├── Inter-Light.otf │ │ │ ├── Inter-LightItalic.otf │ │ │ ├── Inter-UI-Black.otf │ │ │ ├── Inter-UI-BlackItalic.otf │ │ │ ├── Inter-UI-Bold.otf │ │ │ ├── Inter-UI-BoldItalic.otf │ │ │ ├── Inter-UI-Italic.otf │ │ │ ├── Inter-UI-Medium.otf │ │ │ ├── Inter-UI-MediumItalic.otf │ │ │ ├── Inter-UI-Regular.otf │ │ │ ├── Inter-V.otf │ │ │ └── Inter.otf │ │ └── popins │ │ │ ├── Poppins-Black.otf │ │ │ ├── Poppins-BlackItalic.otf │ │ │ ├── Poppins-Bold.otf │ │ │ ├── Poppins-BoldItalic.otf │ │ │ ├── Poppins-ExtraBold.otf │ │ │ ├── Poppins-ExtraBoldItalic.otf │ │ │ ├── Poppins-ExtraLight.otf │ │ │ ├── Poppins-ExtraLightItalic.otf │ │ │ ├── Poppins-Italic.otf │ │ │ ├── Poppins-Light.otf │ │ │ ├── Poppins-LightItalic.otf │ │ │ ├── Poppins-Medium.otf │ │ │ ├── Poppins-MediumItalic.otf │ │ │ ├── Poppins-Regular.otf │ │ │ ├── Poppins-SemiBold.otf │ │ │ ├── Poppins-SemiBoldItalic.otf │ │ │ ├── Poppins-Thin.otf │ │ │ └── Poppins-ThinItalic.otf │ ├── Info.plist │ ├── Settings.bundle │ │ ├── Root.plist │ │ └── en.lproj │ │ │ └── Root.strings │ ├── en.lproj │ │ └── Localisable.strings │ ├── okresy.json │ └── sk.lproj │ │ └── Localizable.strings ├── Segue.swift ├── Services │ ├── Disk │ │ ├── Disk+Codable.swift │ │ ├── Disk+Errors.swift │ │ ├── Disk+Helpers.swift │ │ ├── Disk+InternalHelpers.swift │ │ └── Disk.swift │ ├── FaceID │ │ ├── FaceID.swift │ │ ├── FaceIDCapture.swift │ │ ├── FaceIDStepVerifier.swift │ │ ├── FaceIDStorage.swift │ │ └── FaceIDValidator.swift │ ├── LocationServices │ │ ├── BeaconManager.swift │ │ ├── LocationManagerHandler.swift │ │ ├── LocationReporter.swift │ │ └── LocationTracker.swift │ ├── Networking │ │ ├── APIRequests.swift │ │ ├── APIResponses.swift │ │ ├── CovidService.swift │ │ ├── HTTPRequest.swift │ │ ├── NCZIService.swift │ │ └── NetworkService.swift │ ├── RemoteConfig.swift │ └── UserDefaultsKeys.swift ├── UI │ └── ViewController.swift ├── WelcomeViewController.swift └── en.lproj │ ├── LaunchScreen.strings │ └── Main.strings ├── CovidTests ├── CovidTests.swift └── Info.plist ├── LICENSE ├── Podfile ├── Podfile.lock ├── README.md ├── Vendor └── SPPermissions │ ├── Data │ ├── SPPermissionsColor.swift │ ├── SPPermissionsDelay.swift │ ├── SPPermissionsDraw.swift │ ├── SPPermissionsHaptic.swift │ ├── SPPermissionsOpener.swift │ └── SPPermissionsText.swift │ ├── Interface │ ├── Dialog │ │ ├── Controllers │ │ │ └── SPPermissionsDialogController.swift │ │ └── Views │ │ │ ├── SPPermissionsDialogFooterCommentView.swift │ │ │ └── SPPermissionsDialogView.swift │ ├── List │ │ ├── Controllers │ │ │ └── SPPermissionsListController.swift │ │ └── Views │ │ │ ├── SPPermissionsListFooterCommentView.swift │ │ │ └── SPPermissionsListHeaderView.swift │ ├── Native │ │ └── SPPermissionsNativeController.swift │ └── Shared │ │ ├── Buttons │ │ ├── SPPermissionActionButton.swift │ │ └── SPPermissionsCloseButton.swift │ │ ├── Labels │ │ └── SPPermissionsLabel.swift │ │ ├── Other │ │ ├── SPPermissionIconView.swift │ │ └── SPPermissionsGradeBlurView.swift │ │ └── Tables │ │ └── SPPermissionTableViewCell.swift │ ├── Models │ ├── SPPermission.swift │ └── SPPermissionDeniedAlertData.swift │ ├── Permissions │ ├── Handlers │ │ └── SPRequestPermissionLocationHandler.swift │ ├── SPBluetoothPermission.swift │ ├── SPLocationPermission.swift │ └── SPNotificationPermission.swift │ ├── Protocols │ ├── SPPermissionProtocol.swift │ ├── SPPermissionsControllerProtocol.swift │ ├── SPPermissionsDataSource.swift │ └── SPPermissionsDelegate.swift │ └── SPPermissions.swift └── settings_version.sh /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## User settings 6 | xcuserdata/ 7 | 8 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) 9 | *.xcscmblueprint 10 | *.xccheckout 11 | 12 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) 13 | build/ 14 | DerivedData/ 15 | *.moved-aside 16 | *.pbxuser 17 | !default.pbxuser 18 | *.mode1v3 19 | !default.mode1v3 20 | *.mode2v3 21 | !default.mode2v3 22 | *.perspectivev3 23 | !default.perspectivev3 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | 28 | ## App packaging 29 | *.ipa 30 | *.dSYM.zip 31 | *.dSYM 32 | 33 | ## Playgrounds 34 | timeline.xctimeline 35 | playground.xcworkspace 36 | 37 | # Swift Package Manager 38 | # 39 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 40 | # Packages/ 41 | # Package.pins 42 | # Package.resolved 43 | # *.xcodeproj 44 | # 45 | # Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata 46 | # hence it is not needed unless you have added a package configuration file to your project 47 | # .swiftpm 48 | 49 | .build/ 50 | 51 | # CocoaPods 52 | # 53 | # We recommend against adding the Pods directory to your .gitignore. However 54 | # you should judge for yourself, the pros and cons are mentioned at: 55 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 56 | # 57 | # Pods/ 58 | # 59 | # Add this line if you want to avoid checking in source code from the Xcode workspace 60 | # *.xcworkspace 61 | 62 | # Carthage 63 | # 64 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 65 | # Carthage/Checkouts 66 | 67 | Carthage/Build/ 68 | 69 | # Accio dependency management 70 | Dependencies/ 71 | .accio/ 72 | 73 | # fastlane 74 | # 75 | # It is recommended to not store the screenshots in the git repo. 76 | # Instead, use fastlane to re-generate the screenshots whenever they are needed. 77 | # For more information about the recommended setup visit: 78 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 79 | 80 | fastlane/report.xml 81 | fastlane/Preview.html 82 | fastlane/screenshots/**/*.png 83 | fastlane/test_output 84 | 85 | # Code Injection 86 | # 87 | # After new code Injection tools there's a generated folder /iOSInjectionProject 88 | # https://github.com/johnno1962/injectionforxcode 89 | 90 | iOSInjectionProject/ 91 | Pods 92 | -------------------------------------------------------------------------------- /.swiftlint.yml: -------------------------------------------------------------------------------- 1 | disabled_rules: 2 | - type_body_length 3 | - identifier_name 4 | 5 | excluded: 6 | - Pods 7 | - Vendor 8 | 9 | indentation: tabs 10 | 11 | line_length: 12 | warning: 160 13 | error: 1000 14 | 15 | trailing_whitespace: 16 | severity: warning 17 | 18 | opening_brace: warning 19 | 20 | colon: 21 | severity: warning 22 | 23 | comma: warning 24 | 25 | operator_usage_whitespace: warning 26 | operator_whitespace: warning 27 | 28 | vertical_parameter_alignment: warning 29 | 30 | type_name: warning 31 | 32 | opt_in_rules: 33 | - operator_usage_whitespace 34 | - private_outlet 35 | - weak_delegate 36 | - private_action 37 | - trailing_closure 38 | - attributes 39 | - modifier_order 40 | - fallthrough 41 | - implicit_return 42 | 43 | type_name: 44 | min_length: 3 45 | max_length: 46 | warning: 40 47 | error: 50 48 | excluded: iPhone 49 | reporter: "xcode" 50 | 51 | control_statement: warning 52 | 53 | statement_position: 54 | severity: warning 55 | 56 | implicit_return: 57 | severity: warning 58 | 59 | modifier_order: 60 | preferredModifierOrder: [acl, override] 61 | 62 | attributes: 63 | always_on_line_above: 64 | - "@NSManaged" 65 | - "@discardableResult" 66 | - "@available" 67 | - "@NSCopying" 68 | - "@UIApplicationMain" 69 | - "@objc" 70 | 71 | switch_case_alignment: 72 | severity: warning 73 | 74 | empty_enum_arguments: warning 75 | fallthrough: warning 76 | 77 | force_cast: warning 78 | force_try: warning 79 | 80 | unused_optional_binding: 81 | severity: warning 82 | 83 | closure_parameter_position: warning 84 | multiple_closures_with_trailing_closure: warning 85 | 86 | 87 | # Always leave a space after // 88 | custom_rules: 89 | comments_space: 90 | name: "Space After Comment" 91 | message: "There should be a space after //" 92 | regex: (^ *\/\/\w+) 93 | severity: warning 94 | mark: warning 95 | 96 | todo: 97 | severity: warning 98 | 99 | weak_delegate: warning 100 | -------------------------------------------------------------------------------- /Covid.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Covid.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Covid.xcodeproj/xcshareddata/xcschemes/Covid.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 34 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 71 | 73 | 79 | 80 | 81 | 82 | 84 | 85 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /Covid.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Covid.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Covid/AdditionalInfo/AboutViewController.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | // 25 | // AboutViewController.swift 26 | // Covid 27 | // 28 | // Created by Boris Kolozsi on 17/04/2020. 29 | // 30 | 31 | import UIKit 32 | 33 | final class AboutViewController: ViewController { 34 | @IBOutlet private var aboutTextView: UITextView! 35 | 36 | override func viewDidLoad() { 37 | super.viewDidLoad() 38 | 39 | let attributedString = NSMutableAttributedString(attributedString: aboutTextView.attributedText) 40 | 41 | let textAttachment = NSTextAttachment() 42 | textAttachment.image = UIImage(named: "CE") 43 | 44 | let attrStringWithImage = NSAttributedString(attachment: textAttachment) 45 | attributedString.append(attrStringWithImage) 46 | aboutTextView.attributedText = attributedString 47 | } 48 | 49 | override func viewDidAppear(_ animated: Bool) { 50 | super.viewDidAppear(animated) 51 | aboutTextView.flashScrollIndicators() 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Covid/AdditionalInfo/Covid-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | #include "hashids.h" 6 | -------------------------------------------------------------------------------- /Covid/AdditionalInfo/Hashids.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | // 25 | // Hashids.swift 26 | // Covid 27 | // 28 | // Created by Boris Kolozsi on 14/04/2020. 29 | // 30 | 31 | final class Hashids { 32 | let cHashids: UnsafeMutablePointer? 33 | 34 | init(salt: String = "", minHashLength: Int = 0, alphabet: String = "") { 35 | cHashids = hashids_init3(salt.cString(using: .ascii), minHashLength, alphabet.cString(using: .ascii)) 36 | } 37 | 38 | func encode(_ value: Int) -> String? { 39 | encodeMany([value]) 40 | } 41 | 42 | func encodeMany(_ values: [Int]) -> String? { 43 | let count = values.count 44 | let vals = UnsafeMutablePointer.allocate(capacity: count)// [UInt64](repeating: UInt64(0), count: Int(count)) 45 | for i in 0...allocate(capacity: estimation)//[Int8](repeating: 0, count: estimation) 51 | if hashids_encode(cHashids, buffer, count, vals) > 0 { 52 | return String(cString: buffer, encoding: .ascii) 53 | } 54 | return nil 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Covid/AdditionalInfo/IdentityViewController.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | // 25 | // IdentityViewController.swift 26 | // Covid 27 | // 28 | // Created by Boris Kolozsi on 23/03/2020. 29 | // 30 | 31 | import UIKit 32 | import UILabel_Copyable 33 | import SwiftyUserDefaults 34 | 35 | final class IdentityViewController: ViewController { 36 | @IBOutlet private var idLabel: UILabel! 37 | @IBOutlet private var uploadDataView: UIView! 38 | @IBOutlet private var cooperationLabel: UILabel! 39 | 40 | override func viewWillAppear(_ animated: Bool) { 41 | super.viewWillAppear(animated) 42 | if let covidPass = Defaults.covidPass { 43 | idLabel.text = covidPass 44 | } else if let profileId = Defaults.profileId { 45 | let hashids = Hashids(salt: "COVID-19 super-secure and unguessable hashids salt", minHashLength: 6, alphabet: "ABCDEFGHJKLMNPQRSTUVXYZ23456789") 46 | idLabel.text = hashids.encode(profileId)?.uppercased() 47 | } 48 | 49 | // automatic upload disabled 50 | uploadDataView.isHidden = false // Firebase.remoteBoolValue(for: .reporting) 51 | 52 | navigationController?.navigationBar.isHidden = true 53 | } 54 | 55 | override func viewWillDisappear(_ animated: Bool) { 56 | super.viewWillDisappear(animated) 57 | 58 | navigationController?.navigationBar.isHidden = false 59 | } 60 | 61 | override func loadView() { 62 | super.loadView() 63 | uploadDataView.layer.cornerRadius = 20 64 | uploadDataView.layer.masksToBounds = true 65 | 66 | idLabel.isCopyingEnabled = true 67 | 68 | let text = "Tento projekt vznikol\nako spojenie dobrovoľnej iniciatívy\nZostanZdravy a Sygic" 69 | let attribbutes: [NSAttributedString.Key: Any] = [.font: UIFont(name: "Poppins-Regular", size: 15.0)!, .foregroundColor: UIColor.darkGray] 70 | let attributedString = NSMutableAttributedString(string: text, attributes: attribbutes) 71 | let zostanRange = (attributedString.string as NSString).range(of: "ZostanZdravy") 72 | let sygicRange = (attributedString.string as NSString).range(of: "Sygic") 73 | attributedString.setAttributes([.font: UIFont(name: "Poppins-Bold", size: 15.0)!], range: zostanRange) 74 | attributedString.setAttributes([.font: UIFont(name: "Poppins-Bold", size: 15.0)!], range: sygicRange) 75 | cooperationLabel.attributedText = attributedString 76 | } 77 | 78 | @IBAction private func uploadDataTapped(_ sender: UIButton) { 79 | LocationReporter.shared.sendConnections(forceUpload: true) 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /Covid/AdditionalInfo/PreventionTableViewCell.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | // swiftlint:disable private_outlet 24 | 25 | import UIKit 26 | 27 | final class PreventionTableViewCell: UITableViewCell { 28 | 29 | @IBOutlet private(set) weak var iconImageView: UIImageView! 30 | @IBOutlet private(set) weak var titleLabel: UILabel! 31 | 32 | override func awakeFromNib() { 33 | super.awakeFromNib() 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Covid/AdditionalInfo/PreventionViewController.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | import UIKit 25 | 26 | final class PreventionViewController: ViewController { 27 | 28 | @IBOutlet private weak var tableView: UITableView! 29 | 30 | let datasource = [ 31 | ("prevention01", "Často si umývajte ruky mydlom a vodou, najmenej po dobu 20 sekúnd. Môžete použiť dezinfekčný prostriedok na ruky na báze alkoholu."), 32 | ("prevention02", "Zakrývajte si nos a ústa pri kašľaní a kýchaní jednorázovou papierovou vreckovkou a následne zahoďte."), 33 | ("prevention03", "Nedotýkajte sa očí, nosa a úst neumytými rukami."), 34 | ("prevention04", "Vyhýbajte sa blízkemu kontaktu s ľuďmi, ktorí javia príznak nádchy alebo chrípky."), 35 | ("prevention05", "Noste ochrannú masku v prípade, že sa u Vás alebo u osôb vo Vašej blízkosti prejavujú respiračné symptómy."), 36 | ("prevention06", "Pravidelne čistite a dezinfikujte povrchy a objekty s ktorými ste Vy a Vaše okolie v pravidelnom kontakte."), 37 | ("prevention07", "Ak ste chorý, liečte sa doma.") 38 | ] 39 | 40 | override func viewDidAppear(_ animated: Bool) { 41 | super.viewDidAppear(animated) 42 | tableView.flashScrollIndicators() 43 | } 44 | } 45 | 46 | extension PreventionViewController: UITableViewDataSource { 47 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { datasource.count } 48 | 49 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 50 | let identifier = String(describing: PreventionTableViewCell.self) 51 | guard let cell = tableView.dequeueReusableCell(withIdentifier: identifier, for: indexPath) as? PreventionTableViewCell else { return UITableViewCell() } 52 | 53 | cell.iconImageView.image = UIImage(named: datasource[indexPath.row].0) 54 | cell.titleLabel.text = datasource[indexPath.row].1 55 | cell.selectionStyle = .none 56 | 57 | return cell 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Covid/AdditionalInfo/SymptomsViewController.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | import UIKit 25 | 26 | final class SymptomsViewController: ViewController { 27 | 28 | @IBOutlet private weak var bodyLabel: UILabel! 29 | 30 | override func loadView() { 31 | super.loadView() 32 | 33 | updateUI() 34 | } 35 | } 36 | 37 | extension SymptomsViewController { 38 | 39 | private func updateUI() { 40 | let text = "Ľudia nakazení COVID-19 udávajú široké spektrum prejavov, od miernych až po závažné.\n\nPrejavy sa zvyčajne objavujú 2-14 dní po vystavení sa nákaze a môžu zahŕňať:" 41 | let attributes: [NSAttributedString.Key: Any] = [.font: UIFont(name: "Poppins-Light", size: 17.0)!, .foregroundColor: UIColor.darkGray] 42 | let attributedString = NSMutableAttributedString(string: text, attributes: attributes) 43 | let boldRange = (attributedString.string as NSString).range(of: "2-14 dní po vystavení sa nákaze") 44 | attributedString.setAttributes([.font: UIFont(name: "Poppins-Bold", size: 17.0)!], range: boldRange) 45 | bodyLabel.attributedText = attributedString 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Covid/AdditionalInfo/hashids.h: -------------------------------------------------------------------------------- 1 | #ifndef HASHIDS_H 2 | #define HASHIDS_H 1 3 | 4 | #include 5 | 6 | /* version constants */ 7 | #define HASHIDS_VERSION "1.2.1" 8 | #define HASHIDS_VERSION_MAJOR 1 9 | #define HASHIDS_VERSION_MINOR 2 10 | #define HASHIDS_VERSION_PATCH 1 11 | 12 | /* minimal alphabet length */ 13 | #define HASHIDS_MIN_ALPHABET_LENGTH 16u 14 | 15 | /* separator divisor */ 16 | #define HASHIDS_SEPARATOR_DIVISOR 3.5f 17 | 18 | /* guard divisor */ 19 | #define HASHIDS_GUARD_DIVISOR 12u 20 | 21 | /* default salt */ 22 | #define HASHIDS_DEFAULT_SALT "" 23 | 24 | /* default minimal hash length */ 25 | #define HASHIDS_DEFAULT_MIN_HASH_LENGTH 0u 26 | 27 | /* default alphabet */ 28 | #define HASHIDS_DEFAULT_ALPHABET "abcdefghijklmnopqrstuvwxyz" \ 29 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ" \ 30 | "1234567890" 31 | 32 | /* default separators */ 33 | #define HASHIDS_DEFAULT_SEPARATORS "cfhistuCFHISTU" 34 | 35 | /* error codes */ 36 | #define HASHIDS_ERROR_OK 0 37 | #define HASHIDS_ERROR_ALLOC -1 38 | #define HASHIDS_ERROR_ALPHABET_LENGTH -2 39 | #define HASHIDS_ERROR_ALPHABET_SPACE -3 40 | #define HASHIDS_ERROR_INVALID_HASH -4 41 | #define HASHIDS_ERROR_INVALID_NUMBER -5 42 | 43 | /* thread-safe hashids_errno indirection */ 44 | extern int *__hashids_errno_addr(void); 45 | #define hashids_errno (*__hashids_errno_addr()) 46 | 47 | /* alloc & free */ 48 | extern void *(*_hashids_alloc)(size_t size); 49 | extern void (*_hashids_free)(void *ptr); 50 | 51 | /* the hashids "object" */ 52 | struct hashids_s { 53 | char *alphabet; 54 | char *alphabet_copy_1; 55 | char *alphabet_copy_2; 56 | size_t alphabet_length; 57 | 58 | char *salt; 59 | size_t salt_length; 60 | 61 | char *separators; 62 | size_t separators_count; 63 | 64 | char *guards; 65 | size_t guards_count; 66 | 67 | size_t min_hash_length; 68 | }; 69 | typedef struct hashids_s hashids_t; 70 | 71 | /* exported function definitions */ 72 | void 73 | hashids_shuffle(char *str, size_t str_length, char *salt, size_t salt_length); 74 | 75 | void 76 | hashids_free(hashids_t *hashids); 77 | 78 | hashids_t * 79 | hashids_init3(const char *salt, size_t min_hash_length, 80 | const char *alphabet); 81 | 82 | hashids_t * 83 | hashids_init2(const char *salt, size_t min_hash_length); 84 | 85 | hashids_t * 86 | hashids_init(const char *salt); 87 | 88 | size_t 89 | hashids_estimate_encoded_size(hashids_t *hashids, size_t numbers_count, 90 | unsigned long long *numbers); 91 | 92 | size_t 93 | hashids_estimate_encoded_size_v(hashids_t *hashids, size_t numbers_count, ...); 94 | 95 | size_t 96 | hashids_encode(hashids_t *hashids, char *buffer, size_t numbers_count, 97 | unsigned long long *numbers); 98 | 99 | size_t 100 | hashids_encode_v(hashids_t *hashids, char *buffer, size_t numbers_count, ...); 101 | 102 | size_t 103 | hashids_encode_one(hashids_t *hashids, char *buffer, 104 | unsigned long long number); 105 | 106 | size_t 107 | hashids_numbers_count(hashids_t *hashids, const char *str); 108 | 109 | size_t 110 | hashids_decode(hashids_t *hashids, const char *str, 111 | unsigned long long *numbers, size_t numbers_max); 112 | 113 | size_t 114 | hashids_decode_unsafe(hashids_t *hashids, const char *str, 115 | unsigned long long *numbers); 116 | 117 | size_t 118 | hashids_decode_safe(hashids_t *hashids, const char *str, 119 | unsigned long long *numbers, size_t numbers_max); 120 | 121 | size_t 122 | hashids_encode_hex(hashids_t *hashids, char *buffer, const char *hex_str); 123 | 124 | size_t 125 | hashids_decode_hex(hashids_t *hashids, char *str, char *output); 126 | 127 | #endif 128 | -------------------------------------------------------------------------------- /Covid/Covid.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | aps-environment 6 | development 7 | com.apple.developer.associated-domains 8 | 9 | applinks:nczi.page.link 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Covid/Extensions/CLLocationCoordinate2D.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | import Foundation 25 | import MapKit 26 | 27 | extension CLLocationCoordinate2D: CustomStringConvertible { 28 | public var description: String { 29 | "\(latitude), \(longitude)" 30 | } 31 | 32 | } 33 | 34 | extension CLLocationCoordinate2D { 35 | func coordinateWithOffset(usingLatitudeDelta latitudeDelta: CLLocationDegrees, 36 | longitudeDelta: CLLocationDegrees) -> CLLocationCoordinate2D { 37 | CLLocationCoordinate2D(latitude: latitude + latitudeDelta, 38 | longitude: longitude + longitudeDelta) 39 | } 40 | } 41 | 42 | extension CLLocationCoordinate2D: Equatable { 43 | public static func == (lhs: CLLocationCoordinate2D, rhs: CLLocationCoordinate2D) -> Bool { 44 | (fabs(lhs.latitude - rhs.latitude) < .ulpOfOne) && (fabs(lhs.longitude - rhs.longitude) < .ulpOfOne) 45 | } 46 | 47 | var hash: Int { 48 | Int(latitude * longitude) 49 | } 50 | } 51 | 52 | extension CLLocationCoordinate2D { 53 | var location: CLLocation { 54 | CLLocation(latitude: latitude, longitude: longitude) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Covid/Extensions/DateExtensions.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | // 24 | // DateExtensions.swift 25 | // Covid 26 | // 27 | // Created by Boris Kolozsi on 28/04/2020. 28 | // 29 | 30 | import Foundation 31 | 32 | extension Date { 33 | var timeIntervalSince1970WithoutTime: TimeInterval { 34 | guard let date = Calendar.current.date(from: Calendar.current.dateComponents([.year, .month, .day], from: self)) else { 35 | assertionFailure("wrong date") 36 | return self.timeIntervalSince1970 37 | } 38 | return date.timeIntervalSince1970 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Covid/Extensions/General.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | // 24 | // General.swift 25 | // Covid 26 | // 27 | // Created by Boris Bielik on 04/04/2020. 28 | // Copyright © 2020 Sygic. All rights reserved. 29 | // 30 | 31 | import Foundation 32 | 33 | /// Performs block of code after specified delay 34 | func after(_ delay: DispatchTimeInterval, block: @escaping () -> Void) { 35 | DispatchQueue.main.asyncAfter( 36 | deadline: DispatchTime.now() + delay, 37 | execute: block 38 | ) 39 | } 40 | -------------------------------------------------------------------------------- /Covid/Extensions/NotificationCenterObserver.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | // 24 | // NotificationCenterObserver.swift 25 | // 26 | // Created by Boris Bielik on 09/08/2019. 27 | // 28 | // 29 | 30 | import Foundation 31 | 32 | struct NotificationDescriptor { 33 | let name: Notification.Name 34 | let convert: (Notification) -> T 35 | } 36 | 37 | final class NotificationToken { 38 | private let token: NSObjectProtocol 39 | private let notificationCenter: NotificationCenter 40 | 41 | deinit { 42 | cancel() 43 | } 44 | 45 | init(token: NSObjectProtocol, notificationCenter: NotificationCenter) { 46 | self.token = token 47 | self.notificationCenter = notificationCenter 48 | } 49 | 50 | func cancel() { 51 | notificationCenter.removeObserver(token) 52 | } 53 | } 54 | 55 | extension NotificationCenter { 56 | 57 | func addObserver(forName name: Notification.Name, closure: @escaping (Notification) -> Void) -> NotificationToken { 58 | let token = addObserver(forName: name, object: nil, queue: nil, using: closure) 59 | return NotificationToken(token: token, notificationCenter: self) 60 | } 61 | 62 | func addObserver(descriptor: NotificationDescriptor, using block: @escaping (T) -> Void) -> NotificationToken { 63 | let token = addObserver(forName: descriptor.name, object: nil, queue: nil) { notification in 64 | block(descriptor.convert(notification)) 65 | } 66 | return NotificationToken(token: token, notificationCenter: self) 67 | } 68 | } 69 | 70 | protocol NotificationCenterObserver: class { 71 | 72 | var notificationTokens: [NotificationToken] { get set } 73 | 74 | func unobserveNotifications() 75 | func observeNotification(withName name: NSNotification.Name, closure: @escaping (Notification) -> Void) 76 | } 77 | 78 | extension NotificationCenterObserver { 79 | 80 | func unobserveNotifications() { 81 | notificationTokens.forEach { $0.cancel() } 82 | notificationTokens.removeAll() 83 | } 84 | 85 | func observeNotification(withName name: NSNotification.Name, closure: @escaping (Notification) -> Void) { 86 | let token = NotificationCenter.default.addObserver(forName: name, closure: closure) 87 | notificationTokens.append(token) 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /Covid/Extensions/UINavigationBar+Transparent.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | // 24 | // UINavigationBar+Transparent.swift 25 | // Covid 26 | // 27 | // Created by Boris Bielik on 20/04/2020. 28 | // Copyright © 2020 Sygic. All rights reserved. 29 | // 30 | 31 | import Foundation 32 | import UIKit 33 | 34 | extension UINavigationBar { 35 | func setTransparent(_ isTransparent: Bool) { 36 | let image = isTransparent ? UIImage() : nil 37 | setBackgroundImage(image, for: .default) 38 | shadowImage = image 39 | isTranslucent = true 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Covid/Extensions/UIStoryBoard.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | // 24 | // UIStoryBoard.swift 25 | // Covid 26 | // 27 | // Created by Boris Bielik on 04/04/2020. 28 | // Copyright © 2020 Sygic. All rights reserved. 29 | // 30 | 31 | import Foundation 32 | import UIKit 33 | 34 | protocol HasStoryBoardIdentifier { 35 | static var storyboardIdentifier: String { get } 36 | } 37 | 38 | extension UIStoryboard { 39 | 40 | static var main: UIStoryboard { 41 | UIStoryboard(name: "Main", bundle: nil) 42 | } 43 | 44 | class func controller(ofType type: T.Type) -> T? where T: HasStoryBoardIdentifier { 45 | main.instantiateViewController(withIdentifier: type.storyboardIdentifier) as? T 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Covid/MainScreen/ForeignDecisionViewController.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | import UIKit 25 | import SwiftyUserDefaults 26 | 27 | final class ForeignDecisionViewController: ViewController { 28 | 29 | override func viewDidAppear(_ animated: Bool) { 30 | super.viewDidAppear(animated) 31 | 32 | Defaults.didShowForeignAlert = true 33 | } 34 | 35 | @IBAction private func didTapConfirm(_ sender: Any) { 36 | presentingViewController?.dismiss(animated: true) { 37 | if let controller = (UIApplication.shared.delegate as? AppDelegate)?.visibleViewController() { 38 | controller.performSegue(.startQuarantineFlow) 39 | } 40 | } 41 | } 42 | 43 | @IBAction private func didTapCancel(_ sender: Any) { 44 | presentingViewController?.dismiss(animated: true, completion: nil) 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Covid/MainScreen/QuarantineViewController.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | // 25 | // QuarantineViewController.swift 26 | // Covid 27 | // 28 | // Created by Boris Kolozsi on 16/03/2020. 29 | // 30 | 31 | import UIKit 32 | import SwiftyUserDefaults 33 | 34 | final class QuarantineViewController: ViewController { 35 | @IBOutlet private var addressLabel: UILabel! 36 | @IBOutlet private var quarantineUntilLabel: UILabel! 37 | 38 | private let networkService = CovidService() 39 | 40 | private var quarantineData: QuarantineStatusResponseData? { 41 | didSet { 42 | Defaults.quarantineActive = quarantineData?.isInQuarantine ?? false 43 | if Defaults.quarantineActive { 44 | Defaults.quarantineStart = quarantineData?.quarantineBeginning 45 | Defaults.quarantineEnd = quarantineData?.quarantineEnd 46 | } else { 47 | Defaults.quarantineStart = nil 48 | Defaults.quarantineEnd = nil 49 | } 50 | 51 | DispatchQueue.main.async { 52 | self.updateView() 53 | } 54 | } 55 | } 56 | 57 | override func viewWillAppear(_ animated: Bool) { 58 | super.viewWillAppear(animated) 59 | 60 | guard Defaults.profileId != nil else { return } 61 | 62 | updateView() 63 | updateQuarantineStatus() 64 | } 65 | } 66 | 67 | extension QuarantineViewController { 68 | private func updateQuarantineStatus() { 69 | networkService.requestQuarantineStatus(quarantineRequestData: BasicRequestData()) { [weak self] (result) in 70 | switch result { 71 | case .success(let response): 72 | DispatchQueue.main.async { 73 | self?.quarantineData = response 74 | } 75 | case .failure: break 76 | } 77 | } 78 | } 79 | 80 | private func updateTracking() { 81 | if Defaults.quarantineActive { 82 | LocationTracker.shared.startLocationTracking() 83 | } else { 84 | LocationTracker.shared.stopLocationTracking() 85 | } 86 | } 87 | 88 | private func updateView() { 89 | if let endDate = Defaults.quarantineEnd { 90 | let days = Int(abs(((endDate.timeIntervalSince1970 - Date().timeIntervalSince1970) / 86400).rounded(.awayFromZero))) + 1 91 | quarantineUntilLabel.text = QuarantineViewController.daysToString(days) 92 | } else { 93 | quarantineUntilLabel.text = nil 94 | } 95 | 96 | addressLabel.text = "\(Defaults.quarantineAddress ?? "")\n\(Defaults.quarantineCity ?? "")" 97 | 98 | updateTracking() 99 | } 100 | 101 | private static func daysToString(_ numberOfDays: Int) -> String { 102 | let days: String 103 | 104 | if numberOfDays == 1 { 105 | days = "deň" 106 | } else if numberOfDays >= 2 && numberOfDays <= 4 { 107 | days = "dni" 108 | } else { 109 | days = "dní" 110 | } 111 | 112 | return "\(numberOfDays) \(days)" 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /Covid/MainScreen/StatsViewController.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | // 25 | // StatsViewController.swift 26 | // Covid 27 | // 28 | // Created by Boris Kolozsi on 19/03/2020. 29 | // 30 | 31 | import UIKit 32 | 33 | final class StatsViewController: ViewController { 34 | 35 | @IBOutlet private var positiveView: UIView! 36 | @IBOutlet private var healedView: UIView! 37 | @IBOutlet private var positiveCasesLabel: UILabel! 38 | @IBOutlet private var healedCasesLabel: UILabel! 39 | 40 | override func viewDidLoad() { 41 | super.viewDidLoad() 42 | 43 | NotificationCenter.default.addObserver(self, selector: #selector(reloadData), name: UIApplication.willEnterForegroundNotification, object: nil) 44 | reloadData() 45 | } 46 | 47 | override func loadView() { 48 | super.loadView() 49 | let borderColor = UIColor(red: 217 / 255.0, green: 221 / 255.0, blue: 238 / 255.0, alpha: 1).cgColor 50 | 51 | positiveView.layer.cornerRadius = 10 52 | positiveView.layer.masksToBounds = true 53 | positiveView.layer.borderWidth = 0.5 54 | positiveView.layer.borderColor = borderColor 55 | healedView.layer.cornerRadius = 10 56 | healedView.layer.masksToBounds = true 57 | healedView.layer.borderWidth = 0.5 58 | healedView.layer.borderColor = borderColor 59 | } 60 | 61 | @objc 62 | private func reloadData() { 63 | let urlString = Firebase.remoteStringValue(for: .statsUrl) 64 | guard let url = URL(string: urlString) else { return } 65 | 66 | let task = URLSession.shared.dataTask(with: url) { [weak self] (data, _, error) in 67 | do { 68 | guard let data = data else { return } 69 | 70 | let result = try JSONDecoder().decode(StatsResponseData.self, from: data) 71 | DispatchQueue.main.async { 72 | self?.positiveCasesLabel.text = String(result.totalCases) 73 | self?.healedCasesLabel.text = String(result.totalRecovered) 74 | } 75 | } catch let error { 76 | print(error) 77 | } 78 | } 79 | task.resume() 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /Covid/Map/SpreadMapViewController.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | // 25 | // SpreadMapViewController.swift 26 | // Covid 27 | // 28 | // Created by Boris Kolozsi on 22/03/2020. 29 | // 30 | 31 | import UIKit 32 | import MapKit 33 | 34 | extension RegionInfo: MKAnnotation { 35 | var coordinate: CLLocationCoordinate2D { 36 | location?.coordinate ?? CLLocationCoordinate2D() 37 | } 38 | 39 | var title: String? { 40 | region 41 | } 42 | 43 | var subtitle: String? { 44 | "Počet prípadov: \(cases ?? 0)" 45 | } 46 | } 47 | 48 | final class SpreadMapViewController: ViewController { 49 | 50 | @IBOutlet private var mapView: MKMapView! 51 | 52 | let regionIdenfitier = "region" 53 | 54 | var data = [RegionInfo]() { 55 | didSet { 56 | mapView.removeAnnotations(mapView.annotations) 57 | mapView.addAnnotations(data) 58 | } 59 | } 60 | 61 | override func viewDidLoad() { 62 | super.viewDidLoad() 63 | mapView.showsCompass = false 64 | mapView.isRotateEnabled = false 65 | if #available(iOS 11.0, *) { 66 | mapView.register(MKMarkerAnnotationView.self, forAnnotationViewWithReuseIdentifier: regionIdenfitier) 67 | } 68 | } 69 | 70 | func selectAnnotation(with regionInfo: RegionInfo) { 71 | let annotation = mapView.annotations 72 | .compactMap { $0 as? RegionInfo } 73 | .first { $0.coordinate == regionInfo.coordinate } 74 | guard let regionAnnotation = annotation else { return } 75 | 76 | mapView?.setCenter(regionAnnotation.coordinate, animated: true) 77 | let view = mapView.view(for: regionAnnotation) 78 | if #available(iOS 11.0, *) { 79 | view?.prepareForDisplay() 80 | } 81 | mapView.deselectAnnotation(regionAnnotation, animated: false) 82 | mapView.selectAnnotation(regionAnnotation, animated: true) 83 | } 84 | } 85 | 86 | extension SpreadMapViewController: SwitchableViewController { 87 | func didPresentViewController() {} 88 | } 89 | 90 | extension SpreadMapViewController: MKMapViewDelegate { 91 | func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? { 92 | guard let annotation = annotation as? RegionInfo else { return nil } 93 | if #available(iOS 11.0, *) { 94 | let view = mapView.dequeueReusableAnnotationView(withIdentifier: regionIdenfitier, for: annotation) 95 | view.canShowCallout = true 96 | view.calloutOffset = CGPoint(x: 0, y: 15) 97 | view.rightCalloutAccessoryView = UIView() 98 | return view 99 | } else { 100 | return MKAnnotationView(annotation: annotation, reuseIdentifier: regionIdenfitier) 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /Covid/PrivacyViewController.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | // 25 | // PrivacyViewController.swift 26 | // Covid 27 | // 28 | // Created by Boris Kolozsi on 19/03/2020. 29 | // 30 | 31 | import UIKit 32 | 33 | final class PrivacyViewController: UIViewController { 34 | 35 | @IBOutlet private weak var privacyTextView: UITextView! 36 | 37 | override func viewDidAppear(_ animated: Bool) { 38 | super.viewDidAppear(animated) 39 | privacyTextView.flashScrollIndicators() 40 | } 41 | 42 | @IBAction private func closeDidTap(_ sender: Any) { 43 | presentingViewController?.dismiss(animated: true, completion: nil) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Covid/Quarantine/AddressConfirmationViewController.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | import UIKit 25 | import CoreLocation 26 | import SwiftyUserDefaults 27 | 28 | extension AddressConfirmationViewController: HasStoryBoardIdentifier { 29 | static let storyboardIdentifier = "AddressConfirmationViewController" 30 | } 31 | 32 | final class AddressConfirmationViewController: ViewController { 33 | 34 | @IBOutlet private weak var streetLabel: UILabel! 35 | @IBOutlet private weak var cityLabel: UILabel! 36 | 37 | var streetText: String? 38 | var cityText: String? 39 | var location: CLLocationCoordinate2D? 40 | 41 | private let networkService = CovidService() 42 | 43 | override func viewDidLoad() { 44 | super.viewDidLoad() 45 | 46 | streetLabel.text = streetText 47 | cityLabel.text = cityText 48 | } 49 | 50 | @IBAction private func didTapConfirmButton(_ sender: Any) { 51 | Defaults.quarantineCity = cityText 52 | Defaults.quarantineAddress = streetText 53 | Defaults.quarantineLatitude = location?.latitude 54 | Defaults.quarantineLongitude = location?.longitude 55 | 56 | registerFaceId() 57 | } 58 | 59 | private func registerFaceId() { 60 | if let navigationController = navigationController { 61 | let notification = StartFaceIDRegistrationNotification.notification(with: navigationController) {} 62 | NotificationCenter.default.post(notification) 63 | } else { 64 | preconditionFailure("Awaited navigation controller. Please consider updating the face id flow") 65 | } 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /Covid/Quarantine/FaceID/FaceCaptureCompletedViewController.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | // 24 | // FaceCaptureCompletedViewController.swift 25 | // Covid 26 | // 27 | // Created by Boris Bielik on 04/04/2020. 28 | // Copyright © 2020 Sygic. All rights reserved. 29 | // 30 | 31 | import Foundation 32 | import UIKit 33 | 34 | extension FaceCaptureCompletedViewController: HasStoryBoardIdentifier { 35 | static let storyboardIdentifier = "faceCaptureComplete" 36 | } 37 | 38 | final class FaceCaptureCompletedViewController: UIViewController { 39 | 40 | var useCase: FaceIDUseCase = .registerFace 41 | var didSuccess = true 42 | 43 | private var onCompletion: (() -> Void)? 44 | 45 | @IBOutlet private weak var thankYouLabel: UILabel! 46 | @IBOutlet private weak var descriptionLabel: UILabel! 47 | @IBOutlet private weak var actionButton: UIButton! 48 | @IBOutlet private weak var iconView: UIImageView! 49 | 50 | static func show(using presentationBlock: @escaping (FaceCaptureCompletedViewController) -> Void, onCompletion: @escaping () -> Void) { 51 | if let viewController = UIStoryboard.controller(ofType: Self.self) { 52 | viewController.onCompletion = onCompletion 53 | presentationBlock(viewController) 54 | } 55 | } 56 | 57 | override func viewDidLoad() { 58 | super.viewDidLoad() 59 | navigationItem.hidesBackButton = true 60 | } 61 | 62 | override func viewWillAppear(_ animated: Bool) { 63 | super.viewWillAppear(animated) 64 | thankYouLabel.text = useCase.completionTitle(didSuccess: didSuccess) 65 | descriptionLabel.text = useCase.completionDescription(didSuccess: didSuccess) 66 | actionButton.backgroundColor = useCase.actionButtonColor 67 | iconView.image = useCase.completionIcon(didSuccess: didSuccess) 68 | 69 | self.navigationController?.isNavigationBarHidden = true 70 | } 71 | 72 | @IBAction private func faceCaptureCompleted(_ sender: Any) { 73 | onCompletion?() 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Covid/Quarantine/FaceID/FaceCaptureOnboardingViewController.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | // 24 | // FaceCaptureOnboardingViewController.swift 25 | // Covid 26 | // 27 | // Created by Boris Bielik on 04/04/2020. 28 | // Copyright © 2020 Sygic. All rights reserved. 29 | // 30 | 31 | import Foundation 32 | import UIKit 33 | 34 | extension FaceCaptureOnboardingViewController: HasStoryBoardIdentifier { 35 | static let storyboardIdentifier = "faceCaptureOnboarding" 36 | } 37 | 38 | final class FaceCaptureOnboardingViewController: UIViewController { 39 | 40 | var onStart: (() -> Void)? 41 | 42 | @IBAction private func start(_ sender: Any) { 43 | onStart?() 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /Covid/Quarantine/FaceID/FaceIDNotification.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | // 24 | // FaceIDNotification.swift 25 | // Covid 26 | // 27 | // Created by Boris Bielik on 04/04/2020. 28 | // Copyright © 2020 Sygic. All rights reserved. 29 | // 30 | 31 | import Foundation 32 | import UIKit 33 | 34 | extension Notification.Name { 35 | static let startFaceIDRegistration = Notification.Name("com.covid.startFaceIDRegistration") 36 | } 37 | 38 | struct StartFaceIDRegistrationNotification { 39 | static let navigationControllerKey = "navigationControllerKey" 40 | static let completionKey = "completionKey" 41 | 42 | static func notification(with navigationController: UINavigationController, completion: @escaping () -> Void) -> Notification { 43 | let userInfo = [navigationControllerKey: navigationController, completionKey: completion] as [String: Any] 44 | return Notification(name: .startFaceIDRegistration, 45 | object: nil, 46 | userInfo: userInfo) 47 | } 48 | 49 | static func navigationController(from notification: Notification) -> UINavigationController? { 50 | guard 51 | notification.name == .startFaceIDRegistration, 52 | let navigationController = notification.userInfo?[navigationControllerKey] as? UINavigationController else { return nil } 53 | 54 | return navigationController 55 | } 56 | 57 | static func completion(from notification: Notification) -> (() -> Void)? { 58 | guard 59 | notification.name == .startFaceIDRegistration, 60 | let completion = notification.userInfo?[completionKey] as? () -> Void else { return nil } 61 | 62 | return completion 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Covid/Quarantine/FaceID/FaceIDUseCase.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | // 24 | // FaceIDUseCase.swift 25 | // Covid 26 | // 27 | // Created by Boris Bielik on 04/04/2020. 28 | // Copyright © 2020 Sygic. All rights reserved. 29 | // 30 | 31 | import Foundation 32 | import UIKit 33 | 34 | enum FaceIDUseCase { 35 | case registerFace 36 | case verifyFace 37 | 38 | var title: String { 39 | switch self { 40 | case .registerFace: 41 | return "Odfotiť tvár" 42 | case .verifyFace: 43 | return "Indentifikujte sa tvárou" 44 | } 45 | } 46 | 47 | var verifyTitle: String { 48 | "Overenie tváre" 49 | } 50 | 51 | func completionTitle(didSuccess: Bool) -> String { 52 | didSuccess ? "Ďakujeme" : "Ľutujeme" 53 | } 54 | 55 | func completionDescription(didSuccess: Bool = true) -> String { 56 | switch self { 57 | case .verifyFace where didSuccess: 58 | return """ 59 | Dodržiavajte naďalej dôsledne domácu 60 | karanténu. Zabránite tak šíreniu vírusu 61 | COVID-19. 62 | """ 63 | case .verifyFace where didSuccess == false: 64 | return """ 65 | Nepodarilo sa dokončiť proces zadania karentény. Ak si želáte, môžete neskôr proces zopakovať z hlavného menu. 66 | """ 67 | default: 68 | return """ 69 | Dodržiavajte dôsledne domácu karanténu. 70 | Zabránite tak šíreniu vírusu COVID-19. 71 | """ 72 | } 73 | } 74 | 75 | var actionButtonColor: UIColor { 76 | switch self { 77 | case .registerFace: 78 | return UIColor(red: 80.0 / 255.0, green: 88.0 / 255.0, blue: 249.0 / 255.0, alpha: 1.0) 79 | case .verifyFace: 80 | return UIColor(red: 41.0 / 255.0, green: 192.0 / 255.0, blue: 154.0 / 255.0, alpha: 1.0) 81 | } 82 | } 83 | 84 | func completionIcon(didSuccess: Bool = true) -> UIImage { 85 | guard didSuccess else { return #imageLiteral(resourceName: "ic_check-red") } 86 | 87 | switch self { 88 | case .registerFace: 89 | return #imageLiteral(resourceName: "ic_check-green") 90 | case.verifyFace: 91 | return #imageLiteral(resourceName: "ic_check-grey") 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /Covid/Quarantine/FaceID/FaceIDVerification.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | // 24 | // FaceIDVerification.swift 25 | // Covid 26 | // 27 | // Created by Boris Bielik on 05/04/2020. 28 | // Copyright © 2020 Sygic. All rights reserved. 29 | // 30 | 31 | import Foundation 32 | 33 | // MARK: Verification 34 | 35 | extension FaceCaptureCoordinator { 36 | 37 | private func startVerifying() { 38 | coordinator = LivenessStepCoordinator() 39 | coordinator?.delegate = self 40 | if let controller = coordinator?.createVerifyController(transitionType: .move) { 41 | controller.title = useCase.verifyTitle 42 | controller.navigationItem.hidesBackButton = true 43 | navigationController?.pushViewController(controller, animated: true) 44 | step = .faceVerification 45 | } 46 | } 47 | } 48 | 49 | extension FaceCaptureCoordinator: LivenessStepDelegate { 50 | 51 | private func validateSegmentImages(_ segmentImages: [SegmentImage]) { 52 | let result = faceIdValidator.validateSegmentImagesToReferenceTemplate(segmentImages) 53 | switch result { 54 | case .success: 55 | print("verify: success") 56 | completeFaceCapture(didSuccess: true) 57 | default: 58 | break 59 | } 60 | } 61 | 62 | func liveness(_ step: LivenessStepCoordinator, didSucceed score: Float, capturedSegmentImages segmentImages: [SegmentImage]) { 63 | debugPrint(#function) 64 | validateSegmentImages(segmentImages) 65 | step.stopVerifying() 66 | } 67 | 68 | func liveness(_ step: LivenessStepCoordinator, didFailed score: Float, capturedSegmentImages segmentImages: [SegmentImage]) { 69 | debugPrint(#function) 70 | validateSegmentImages(segmentImages) 71 | } 72 | 73 | func livenessdidFailedWithEyesNotDetected(_ step: LivenessStepCoordinator) { 74 | debugPrint(#function) 75 | livenessFailed(step) 76 | } 77 | 78 | func livenessFailed(_ step: LivenessStepCoordinator) { 79 | switch useCase { 80 | case .registerFace: 81 | askToVerifyAgain { _ in 82 | step.restartVerifying() 83 | } 84 | 85 | case .verifyFace: 86 | guard retryVerifyCount < 1 else { 87 | completeFaceCapture(didSuccess: false) 88 | return 89 | } 90 | 91 | retryVerifyCount += 1 92 | askToVerifyAgain { _ in 93 | step.restartVerifying() 94 | } 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /Covid/Quarantine/SelectAddressInfoViewController.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | import UIKit 25 | 26 | final class SelectAddressInfoViewController: ViewController { 27 | 28 | @IBOutlet private weak var selectButton: UIButton! 29 | 30 | override func viewDidLoad() { 31 | super.viewDidLoad() 32 | 33 | setupUI() 34 | } 35 | } 36 | 37 | extension SelectAddressInfoViewController { 38 | 39 | private func setupUI() { 40 | let substring1 = "Vybrať adresu mojej\n" 41 | let substring2 = "karantény" 42 | 43 | let paragraph = NSMutableParagraphStyle() 44 | paragraph.alignment = .center 45 | let font: UIFont = UIFont(name: "Poppins-Bold", size: 17) ?? UIFont.systemFont(ofSize: 17, weight: .heavy) 46 | let attributes = [NSMutableAttributedString.Key.font: font, 47 | .foregroundColor: UIColor.white, 48 | NSAttributedString.Key.paragraphStyle: paragraph] 49 | let attrString1 = NSMutableAttributedString(string: substring1, attributes: attributes) 50 | let attrString2 = NSMutableAttributedString(string: substring2, attributes: attributes) 51 | attrString1.append(attrString2) 52 | 53 | selectButton?.titleLabel?.lineBreakMode = NSLineBreakMode.byWordWrapping 54 | selectButton?.setAttributedTitle(attrString1, for: []) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "Icon-App-20x20@2x.png", 5 | "idiom" : "iphone", 6 | "scale" : "2x", 7 | "size" : "20x20" 8 | }, 9 | { 10 | "filename" : "Icon-App-20x20@3x.png", 11 | "idiom" : "iphone", 12 | "scale" : "3x", 13 | "size" : "20x20" 14 | }, 15 | { 16 | "filename" : "Icon-App-29x29@1x.png", 17 | "idiom" : "iphone", 18 | "scale" : "1x", 19 | "size" : "29x29" 20 | }, 21 | { 22 | "filename" : "Icon-App-29x29@2x.png", 23 | "idiom" : "iphone", 24 | "scale" : "2x", 25 | "size" : "29x29" 26 | }, 27 | { 28 | "filename" : "Icon-App-29x29@3x.png", 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "29x29" 32 | }, 33 | { 34 | "filename" : "Icon-App-40x40@2x.png", 35 | "idiom" : "iphone", 36 | "scale" : "2x", 37 | "size" : "40x40" 38 | }, 39 | { 40 | "filename" : "Icon-App-40x40@3x.png", 41 | "idiom" : "iphone", 42 | "scale" : "3x", 43 | "size" : "40x40" 44 | }, 45 | { 46 | "filename" : "Icon-App-60x60@2x.png", 47 | "idiom" : "iphone", 48 | "scale" : "2x", 49 | "size" : "60x60" 50 | }, 51 | { 52 | "filename" : "Icon-App-60x60@3x.png", 53 | "idiom" : "iphone", 54 | "scale" : "3x", 55 | "size" : "60x60" 56 | }, 57 | { 58 | "filename" : "Icon-App-20x20@1x.png", 59 | "idiom" : "ipad", 60 | "scale" : "1x", 61 | "size" : "20x20" 62 | }, 63 | { 64 | "filename" : "Icon-App-20x20@2x.png", 65 | "idiom" : "ipad", 66 | "scale" : "2x", 67 | "size" : "20x20" 68 | }, 69 | { 70 | "filename" : "Icon-App-29x29@1x.png", 71 | "idiom" : "ipad", 72 | "scale" : "1x", 73 | "size" : "29x29" 74 | }, 75 | { 76 | "filename" : "Icon-App-29x29@2x.png", 77 | "idiom" : "ipad", 78 | "scale" : "2x", 79 | "size" : "29x29" 80 | }, 81 | { 82 | "filename" : "Icon-App-40x40@1x.png", 83 | "idiom" : "ipad", 84 | "scale" : "1x", 85 | "size" : "40x40" 86 | }, 87 | { 88 | "filename" : "Icon-App-40x40@2x.png", 89 | "idiom" : "ipad", 90 | "scale" : "2x", 91 | "size" : "40x40" 92 | }, 93 | { 94 | "filename" : "Icon-App-76x76@1x.png", 95 | "idiom" : "ipad", 96 | "scale" : "1x", 97 | "size" : "76x76" 98 | }, 99 | { 100 | "filename" : "Icon-App-76x76@2x.png", 101 | "idiom" : "ipad", 102 | "scale" : "2x", 103 | "size" : "76x76" 104 | }, 105 | { 106 | "filename" : "Icon-App-83.5x83.5@2x.png", 107 | "idiom" : "ipad", 108 | "scale" : "2x", 109 | "size" : "83.5x83.5" 110 | }, 111 | { 112 | "filename" : "ItunesArtwork@2x.png", 113 | "idiom" : "ios-marketing", 114 | "scale" : "1x", 115 | "size" : "1024x1024" 116 | } 117 | ], 118 | "info" : { 119 | "author" : "xcode", 120 | "version" : 1 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/CE.imageset/CE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/CE.imageset/CE.png -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/CE.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "CE.png", 5 | "idiom" : "universal" 6 | } 7 | ], 8 | "info" : { 9 | "author" : "xcode", 10 | "version" : 1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/DOC-character.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "DOC-character.pdf", 5 | "idiom" : "universal" 6 | } 7 | ], 8 | "info" : { 9 | "author" : "xcode", 10 | "version" : 1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/DOC-character.imageset/DOC-character.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/DOC-character.imageset/DOC-character.pdf -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/ID-character.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "ID-character.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/ID-character.imageset/ID-character.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/ID-character.imageset/ID-character.pdf -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/ID.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "ID.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template" 14 | } 15 | } -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/ID.imageset/ID.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/ID.imageset/ID.pdf -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/Prevention/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/Prevention/prevention01.imageset/01.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/Prevention/prevention01.imageset/01.pdf -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/Prevention/prevention01.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "01.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/Prevention/prevention02.imageset/02.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/Prevention/prevention02.imageset/02.pdf -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/Prevention/prevention02.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "02.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/Prevention/prevention03.imageset/03.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/Prevention/prevention03.imageset/03.pdf -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/Prevention/prevention03.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "03.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/Prevention/prevention04.imageset/04.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/Prevention/prevention04.imageset/04.pdf -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/Prevention/prevention04.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "04.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/Prevention/prevention05.imageset/05.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/Prevention/prevention05.imageset/05.pdf -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/Prevention/prevention05.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "05.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/Prevention/prevention06.imageset/06.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/Prevention/prevention06.imageset/06.pdf -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/Prevention/prevention06.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "06.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/Prevention/prevention07.imageset/07.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/Prevention/prevention07.imageset/07.pdf -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/Prevention/prevention07.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "07.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/ZZ-logo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "ZZ-logo.pdf", 5 | "idiom" : "universal" 6 | } 7 | ], 8 | "info" : { 9 | "author" : "xcode", 10 | "version" : 1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/ZZ-logo.imageset/ZZ-logo.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/ZZ-logo.imageset/ZZ-logo.pdf -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/about-app-icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "about-app-icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/about-app-icon.imageset/about-app-icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/about-app-icon.imageset/about-app-icon.pdf -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/arrow.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "arrow.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template" 14 | } 15 | } -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/arrow.imageset/arrow.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/arrow.imageset/arrow.pdf -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/edit-icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "edit-icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/edit-icon.imageset/edit-icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/edit-icon.imageset/edit-icon.pdf -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/home.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "home.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template" 14 | } 15 | } -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/home.imageset/home.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/home.imageset/home.pdf -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/howtoprotect.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "howtoprotect.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "original", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/howtoprotect.imageset/howtoprotect.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/howtoprotect.imageset/howtoprotect.pdf -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/ic_check-green.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "ic_check-green.pdf", 5 | "idiom" : "universal" 6 | } 7 | ], 8 | "info" : { 9 | "author" : "xcode", 10 | "version" : 1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/ic_check-green.imageset/ic_check-green.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/ic_check-green.imageset/ic_check-green.pdf -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/ic_check-grey.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "ic_check-grey (1).pdf", 5 | "idiom" : "universal" 6 | } 7 | ], 8 | "info" : { 9 | "author" : "xcode", 10 | "version" : 1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/ic_check-grey.imageset/ic_check-grey (1).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/ic_check-grey.imageset/ic_check-grey (1).pdf -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/ic_check-red.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "ic_check-grey (2).pdf", 5 | "idiom" : "universal" 6 | } 7 | ], 8 | "info" : { 9 | "author" : "xcode", 10 | "version" : 1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/ic_check-red.imageset/ic_check-grey (2).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/ic_check-red.imageset/ic_check-grey (2).pdf -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/ic_faceid-logo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "ic_faceid-logo (1).pdf", 5 | "idiom" : "universal" 6 | } 7 | ], 8 | "info" : { 9 | "author" : "xcode", 10 | "version" : 1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/ic_faceid-logo.imageset/ic_faceid-logo (1).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/ic_faceid-logo.imageset/ic_faceid-logo (1).pdf -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/info-icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "info-icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/info-icon.imageset/info-icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/info-icon.imageset/info-icon.pdf -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/map-icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "map-icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template" 14 | } 15 | } -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/map-icon.imageset/map-icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/map-icon.imageset/map-icon.pdf -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/mzsr.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "mzsr.png", 5 | "idiom" : "universal" 6 | } 7 | ], 8 | "info" : { 9 | "author" : "xcode", 10 | "version" : 1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/mzsr.imageset/mzsr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/mzsr.imageset/mzsr.png -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/nczi.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "nczi-logo.png", 5 | "idiom" : "universal" 6 | } 7 | ], 8 | "info" : { 9 | "author" : "xcode", 10 | "version" : 1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/nczi.imageset/nczi-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/nczi.imageset/nczi-logo.png -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/pin-select-location.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "pin-select-location.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/pin-select-location.imageset/pin-select-location.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/pin-select-location.imageset/pin-select-location.pdf -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/pin.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "pin2.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/pin.imageset/pin2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/pin.imageset/pin2.pdf -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/send-data.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "send-data.pdf", 5 | "idiom" : "universal" 6 | } 7 | ], 8 | "info" : { 9 | "author" : "xcode", 10 | "version" : 1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/send-data.imageset/send-data.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/send-data.imageset/send-data.pdf -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/slide-map.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "slide.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/slide-map.imageset/slide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/slide-map.imageset/slide.pdf -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/symptomes.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "symptomes.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "original", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /Covid/Resources/Assets.xcassets/symptomes.imageset/symptomes.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Assets.xcassets/symptomes.imageset/symptomes.pdf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/interUI/Inter-Black.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/interUI/Inter-Black.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/interUI/Inter-BlackItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/interUI/Inter-BlackItalic.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/interUI/Inter-Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/interUI/Inter-Bold.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/interUI/Inter-BoldItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/interUI/Inter-BoldItalic.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/interUI/Inter-ExtraBold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/interUI/Inter-ExtraBold.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/interUI/Inter-ExtraBoldItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/interUI/Inter-ExtraBoldItalic.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/interUI/Inter-ExtraLight.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/interUI/Inter-ExtraLight.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/interUI/Inter-ExtraLightItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/interUI/Inter-ExtraLightItalic.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/interUI/Inter-Italic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/interUI/Inter-Italic.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/interUI/Inter-Light.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/interUI/Inter-Light.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/interUI/Inter-LightItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/interUI/Inter-LightItalic.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/interUI/Inter-UI-Black.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/interUI/Inter-UI-Black.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/interUI/Inter-UI-BlackItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/interUI/Inter-UI-BlackItalic.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/interUI/Inter-UI-Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/interUI/Inter-UI-Bold.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/interUI/Inter-UI-BoldItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/interUI/Inter-UI-BoldItalic.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/interUI/Inter-UI-Italic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/interUI/Inter-UI-Italic.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/interUI/Inter-UI-Medium.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/interUI/Inter-UI-Medium.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/interUI/Inter-UI-MediumItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/interUI/Inter-UI-MediumItalic.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/interUI/Inter-UI-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/interUI/Inter-UI-Regular.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/interUI/Inter-V.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/interUI/Inter-V.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/interUI/Inter.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/interUI/Inter.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/popins/Poppins-Black.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/popins/Poppins-Black.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/popins/Poppins-BlackItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/popins/Poppins-BlackItalic.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/popins/Poppins-Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/popins/Poppins-Bold.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/popins/Poppins-BoldItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/popins/Poppins-BoldItalic.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/popins/Poppins-ExtraBold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/popins/Poppins-ExtraBold.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/popins/Poppins-ExtraBoldItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/popins/Poppins-ExtraBoldItalic.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/popins/Poppins-ExtraLight.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/popins/Poppins-ExtraLight.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/popins/Poppins-ExtraLightItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/popins/Poppins-ExtraLightItalic.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/popins/Poppins-Italic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/popins/Poppins-Italic.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/popins/Poppins-Light.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/popins/Poppins-Light.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/popins/Poppins-LightItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/popins/Poppins-LightItalic.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/popins/Poppins-Medium.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/popins/Poppins-Medium.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/popins/Poppins-MediumItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/popins/Poppins-MediumItalic.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/popins/Poppins-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/popins/Poppins-Regular.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/popins/Poppins-SemiBold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/popins/Poppins-SemiBold.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/popins/Poppins-SemiBoldItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/popins/Poppins-SemiBoldItalic.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/popins/Poppins-Thin.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/popins/Poppins-Thin.otf -------------------------------------------------------------------------------- /Covid/Resources/Fonts/popins/Poppins-ThinItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Fonts/popins/Poppins-ThinItalic.otf -------------------------------------------------------------------------------- /Covid/Resources/Settings.bundle/Root.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | Title 9 | About 10 | Type 11 | PSGroupSpecifier 12 | 13 | 14 | DefaultValue 15 | 1.1.2 (192) 16 | Key 17 | app_version 18 | Title 19 | Version 20 | Type 21 | PSTitleValueSpecifier 22 | 23 | 24 | StringsTable 25 | Root 26 | 27 | 28 | -------------------------------------------------------------------------------- /Covid/Resources/Settings.bundle/en.lproj/Root.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CovidWorld/ios/45eb1296cf6128a7bc4c280c4304156113184f11/Covid/Resources/Settings.bundle/en.lproj/Root.strings -------------------------------------------------------------------------------- /Covid/Resources/en.lproj/Localisable.strings: -------------------------------------------------------------------------------- 1 | "face_capture.title" = "Enrollment"; 2 | 3 | "face_capture.hint.centerFace" = "Center your face into the circle"; 4 | "face_capture.hint.light" = "Rotate face towards light source"; 5 | "face_capture.hint.done" = "That's it!"; 6 | "face_capture.hint.start" = "Start"; 7 | "face_capture.hint.title" = "Instructions"; 8 | 9 | "face_capture.instruction_step.light.first" = "Move towards light"; 10 | "face_capture.instruction_step.light.second" = "Rotate your face towards the light"; 11 | "face_capture.instruction_step.capture" = "Stay still!"; 12 | 13 | "face_capture.instruction_step.position.simple" = "Center your face into the circle"; 14 | "face_capture.instruction_step.position.andvancedTitle" = "Center your face"; 15 | "face_capture.instruction_step.position.andvancedText" = "Hold the device at eye level.\n Align your face to the center of the circle.\nAdjust the distance between your device and your face."; 16 | 17 | "face_capture.instruction_step.light.simple" = "Rotate face towards light source"; 18 | "face_capture.instruction_step.light.andvancedTitle" = "Rotate towards light"; 19 | "face_capture.instruction_step.light.andvancedText" = "Find a front light source.\nAvoid lights casting strong shadows on your face (top or side lights).\nAvoid strong back-light."; 20 | 21 | "face_capture.done" = "That\'s it!"; 22 | 23 | "face_capture.alert.camera.title" = "Camera usage not allowed"; 24 | "face_capture.alert.camera.message" = "Go to Settings?"; 25 | "face_capture.alert.camera.option.settings" = "Settings"; 26 | "face_capture.alert.camera.option.cancel" = "Cancel"; 27 | 28 | "face_capture.confirmation.title" = "Verify resulting photo"; 29 | "face_capture.confirmation.accept" = "Accept"; 30 | "face_capture.confirmation.tryAgain" = "Try again"; 31 | 32 | "face_capture.failedTitle" = "Enrollment"; 33 | "face_capture.failed" = "Enrollment failed"; 34 | "face_capture.failedTip" = "Please read the following tips:"; 35 | 36 | "liveness.title" = "Liveness Detection"; 37 | "liveness.instruction_step.light" = "Rotate face towards light source"; 38 | "liveness.instruction_step.eyePosition" = "Hold the phone at the eye level"; 39 | "liveness.instruction_step.glasses" = "Remove your glasses"; 40 | "liveness.instruction_step.start" = "START"; 41 | 42 | 43 | 44 | "face_capture.instruction_step.center.first" = "Center your face"; 45 | "face_capture.instruction_step.center.second" = "Move your face to the center of the circle"; 46 | "face_capture.instruction_step.close.first" = "Move back"; 47 | "face_capture.instruction_step.close.second" = "Move your device away from your face"; 48 | "face_capture.instruction_step.far.first" = "Move closer"; 49 | "face_capture.instruction_step.far.second" = "Move your device closer to your face"; 50 | "face_capture.instruction_step.light.first" = "Move towards light"; 51 | "face_capture.instruction_step.light.second" = "Rotate your face towards the light"; 52 | "face_capture.instruction_step.capture" = "Stay still!"; 53 | 54 | "liveness.watchObject" = "Watch the object"; 55 | "liveness.state.lowQuality" = "Move towards light"; 56 | "liveness.state.multiFace" = ""; 57 | "liveness.state.noFace" = "Look straight"; 58 | "liveness.state.templateNotMatching" = ""; 59 | "liveness.state.tooClose" = "Move back"; 60 | "liveness.state.tooFar" = "Move closer"; 61 | 62 | "document_capture.type_front.side" = "Front Side"; 63 | "document_capture.type_front.hint" = "Take picture of front side"; 64 | "document_capture.type_back.side" = "Back Side"; 65 | "document_capture.type_back.hint" = "Take picture of back side"; 66 | 67 | "document_review.info_bar.uncertainItems" = "%d"; 68 | "document_review.info_bar.ok" = "All items recognized"; 69 | "document_review.title.uncertain" = "Please verify all the data."; 70 | "document_review.title.ok" = "Please verify all the data."; 71 | "document_review.subtitle.uncertain" = "Uncertain items require special attention."; 72 | "document_review.subtitle.ok" = "All items were recognized successfully."; 73 | "document_review.allCorrenct" = "All correct"; 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /Covid/Resources/sk.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | "face_capture.hint.centerFace" = "Vycentrujte tvár na stred kruhu"; 2 | "face_capture.hint.light" = "Nasmerujte tvár k svetlu!"; 3 | "face_capture.hint.done" = "Správne"; 4 | "face_capture.hint.start" = "Začnite"; 5 | "face_capture.hint.title" = "Inštrukcie"; 6 | 7 | "face_capture.instruction_step.center.first" = "Vycentrujte tvár"; 8 | "face_capture.instruction_step.center.second" = "Posuňte tvár smerom k stredu kruhu"; 9 | "face_capture.instruction_step.close.first" = "Posuňte sa späť"; 10 | "face_capture.instruction_step.close.second" = "Posuňte zariadenie ďalej od tváre"; 11 | "face_capture.instruction_step.far.first" = "Bližšie, prosím"; 12 | "face_capture.instruction_step.far.second" = "Posuňte zariadenie bližšie k tvári"; 13 | "face_capture.instruction_step.light.first" = "Prisuňte sa bližšie k svetlu"; 14 | "face_capture.instruction_step.light.second" = "Natočte tvár smerom k svetlu"; 15 | "face_capture.instruction_step.capture" = "Nehýbte sa!"; 16 | 17 | 18 | "face_capture.instruction_step.light.first" = "Prisuňte sa bližšie k svetlu"; 19 | "face_capture.instruction_step.light.second" = "Natočte tvár smerom k svetlu"; 20 | "face_capture.instruction_step.capture" = "Nehýbte sa!"; 21 | 22 | "face_capture.instruction_step.position.simple" = "Vycentrujte tvár na stred kruhu"; 23 | "face_capture.instruction_step.position.andvancedTitle" = "Vycentrujte tvár"; 24 | "face_capture.instruction_step.position.andvancedText" = "Držte zariadenie v úrovni očí.\n Vycentrujte tvár na stred kruhu.\nUpravte vzdialenosť tváre a zariadenia."; 25 | 26 | "face_capture.instruction_step.light.simple" = "Nasmerujte tvár k svetlu"; 27 | "face_capture.instruction_step.light.andvancedTitle" = "Rotate towards light"; 28 | "face_capture.instruction_step.light.andvancedText" = "Vyhľadajte predný zdroj svetla.\nVyhnite sa svetlu vrhajúcemu ostré tiene (vrchné alebo bočné svetlo).\nVyhýbajte sa zadnému zdroju svetla."; 29 | 30 | "face_capture.alert.camera.title" = "Nie je povolená kamera"; 31 | "face_capture.alert.camera.message" = "Vstúpiť do nastavení?"; 32 | "face_capture.alert.camera.option.settings" = "Nastavenia"; 33 | "face_capture.alert.camera.option.cancel" = "Zrušiť"; 34 | 35 | "face_capture.confirmation.title" = "Skontrolujte výslednú fotografiu"; 36 | "face_capture.confirmation.accept" = "Potvrdiť"; 37 | "face_capture.confirmation.tryAgain" = "Skúsiť znova"; 38 | 39 | "face_capture.failedTitle" = "Zaznamenávanie"; 40 | "face_capture.failed" = "Zaznamenávanie zlyhalo"; 41 | "face_capture.failedTip" = "Prečítajte si tipy:"; 42 | 43 | "liveness.title" = "Overovanie identity"; 44 | "liveness.instruction_step.light" = "Natočte tvár smerom k svetlu"; 45 | "liveness.instruction_step.eyePosition" = "Držte zariadenie na úrovni očí"; 46 | "liveness.instruction_step.glasses" = "Zložte si okuliare"; 47 | 48 | "liveness.watchObject" = "Sledujte pohyblivý bod"; 49 | "liveness.state.lowQuality" = "Prisuňte sa bližšie k svetlu"; 50 | "liveness.state.multiFace" = ""; 51 | "liveness.state.noFace" = "Pozerajte sa priamo na bod"; 52 | "liveness.state.templateNotMatching" = ""; 53 | "liveness.state.tooClose" = "Posuňte sa dozadu"; 54 | "liveness.state.tooFar" = "Posuňte sa bližšie"; 55 | -------------------------------------------------------------------------------- /Covid/Segue.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Segue.swift 3 | // Covid 4 | // 5 | // Created by Boris Bielik on 07/04/2020. 6 | // Copyright © 2020 Sygic. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | enum Segue: String { 13 | case quarantineVerifyNumber 14 | case startQuarantineFlow = "initQuarantine" 15 | case foreignAlert 16 | case searchAddress = "search" 17 | case phoneNumberVerification = "verification" 18 | } 19 | 20 | extension UIViewController { 21 | 22 | func performSegue(_ segue: Segue) { 23 | performSegue(withIdentifier: segue.rawValue, sender: self) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Covid/Services/Disk/Disk+Errors.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // 3 | // Copyright (c) 2017 Saoud Rizwan 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | import Foundation 24 | 25 | extension Disk { 26 | public enum ErrorCode: Int { 27 | case noFileFound = 0 28 | case serialization = 1 29 | case deserialization = 2 30 | case invalidFileName = 3 31 | case couldNotAccessTemporaryDirectory = 4 32 | case couldNotAccessUserDomainMask = 5 33 | case couldNotAccessSharedContainer = 6 34 | } 35 | 36 | public static let errorDomain = "DiskErrorDomain" 37 | 38 | /// Create custom error that FileManager can't account for 39 | static func createError(_ errorCode: ErrorCode, description: String?, failureReason: String?, recoverySuggestion: String?) -> Error { 40 | let errorInfo: [String: Any] = [NSLocalizedDescriptionKey: description ?? "", 41 | NSLocalizedRecoverySuggestionErrorKey: recoverySuggestion ?? "", 42 | NSLocalizedFailureReasonErrorKey: failureReason ?? ""] 43 | return NSError(domain: errorDomain, code: errorCode.rawValue, userInfo: errorInfo) as Error 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Covid/Services/FaceID/FaceID.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | // 24 | // FaceID.swift 25 | // Covid 26 | // 27 | // Created by Boris Bielik on 04/04/2020. 28 | // Copyright © 2020 Sygic. All rights reserved. 29 | // 30 | 31 | import Foundation 32 | import DOT 33 | import AVKit 34 | 35 | struct FaceID { 36 | 37 | static var faceIDMatchThreshold: Int { 38 | Int(Firebase.remoteDoubleValue(for: .faceIDMatchThreshold)) 39 | } 40 | 41 | static var faceDetectionConfidenceThreshold: Int { 42 | Int(Firebase.remoteDoubleValue(for: .faceIDConfidenceThreshold)) 43 | } 44 | 45 | static func initialize() { 46 | if let path = Bundle.main.path(forResource: "iengine", ofType: "lic") { 47 | do { 48 | let license = try License(path: path) 49 | 50 | DOTHandler.initialize(with: license, 51 | faceDetectionConfidenceThreshold: faceDetectionConfidenceThreshold) 52 | DOTHandler.localizationBundle = .main 53 | } catch { 54 | print(error) 55 | } 56 | } 57 | } 58 | 59 | static func deinitialize() { 60 | DOTHandler.deinitialize() 61 | } 62 | 63 | func checkCameraPermission(status: AVAuthorizationStatus, 64 | controller: UIViewController, 65 | onAuthorized: @escaping () -> Void, 66 | onCancel: @escaping () -> Void) { 67 | if status != .authorized { 68 | let alertController = UIAlertController(title: "Nie je povolená kamera", 69 | message: "Otvoriť Nastavenia?", 70 | preferredStyle: .alert) 71 | 72 | let settingsAction = UIAlertAction(title: "Nastavenia", style: .default) { (_) -> Void in 73 | let settingsUrl = URL(string: UIApplication.openSettingsURLString)! 74 | UIApplication.shared.open(settingsUrl) 75 | } 76 | 77 | let cancelAction = UIAlertAction(title: "Zrušiť", style: .cancel) { _ -> Void in 78 | onCancel() 79 | } 80 | 81 | alertController.addAction(settingsAction) 82 | alertController.addAction(cancelAction) 83 | alertController.preferredAction = settingsAction 84 | 85 | controller.present(alertController, animated: true, completion: nil) 86 | } else { 87 | onAuthorized() 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /Covid/Services/FaceID/FaceIDStorage.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | // 24 | // FaceIDStorage.swift 25 | // Covid 26 | // 27 | // Created by Boris Bielik on 03/04/2020. 28 | // Copyright © 2020 Sygic. All rights reserved. 29 | // 30 | 31 | import Foundation 32 | import DOT 33 | import SwiftyUserDefaults 34 | 35 | final class FaceIDStorage { 36 | 37 | @SwiftyUserDefault(keyPath: \.referenceFace, options: [.cached, .observed]) 38 | var referenceFaceData: [Int8]? 39 | 40 | func saveReferenceFace(_ faceCaptureImage: FaceCaptureImage) { 41 | referenceFaceData = faceCaptureImage.faceTemplate?.data 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Covid/Services/Networking/APIResponses.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | // 25 | // APIResponses.swift 26 | // Covid 27 | // 28 | // Created by Boris Kolozsi on 12/03/2020. 29 | // 30 | 31 | import Foundation 32 | 33 | struct RegisterProfileResponseData: Codable { 34 | let profileId: Int 35 | let deviceId: String 36 | } 37 | 38 | struct QuarantineStatusResponseData: Codable { 39 | let isInQuarantine: Bool 40 | let quarantineBeginning: Date? 41 | let quarantineEnd: Date? 42 | } 43 | 44 | struct StatsResponseData: Codable { 45 | enum CodingKeys: String, CodingKey { 46 | case totalRecovered = "recovered" 47 | case totalCases = "total_cases" 48 | case totalDeaths = "total_deaths" 49 | } 50 | 51 | let totalCases: Int 52 | let totalDeaths: Int 53 | let totalRecovered: Int 54 | } 55 | 56 | // MARK: - NCZI Services - 57 | struct OTPResponseData: Codable { 58 | var errors: [OTPResponseError]? 59 | var payload: OTPResponsePayload? 60 | } 61 | 62 | struct OTPResponseErrorData: Codable { 63 | let errors: [OTPResponseError] 64 | } 65 | 66 | struct OTPResponseSuccessData: Codable { 67 | let payload: OTPResponsePayload 68 | } 69 | 70 | struct OTPResponsePayload: Codable { 71 | let vAccessToken: String 72 | } 73 | 74 | struct OTPResponseError: Codable { 75 | let title: String 76 | let description: String 77 | } 78 | -------------------------------------------------------------------------------- /Covid/Services/Networking/HTTPRequest.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | import Foundation 25 | 26 | protocol NetworkSession { 27 | @discardableResult 28 | func loadData(for urlRequest: URLRequest, completion: @escaping (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask 29 | } 30 | 31 | /// Handy extension - URLSession is usually used as NetworkSession. 32 | extension URLSession: NetworkSession { 33 | @discardableResult 34 | func loadData(for urlRequest: URLRequest, completion: @escaping (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask { 35 | let task = dataTask(with: urlRequest, completionHandler: completion) 36 | task.resume() 37 | return task 38 | } 39 | } 40 | 41 | /// Class used to perform HTTP requests. 42 | final class HTTPRequest { 43 | 44 | /// Error returned from HTTP request 45 | enum Error: Swift.Error { 46 | /// Indicate url error with underlying URLError 47 | case urlError(URLError?) 48 | /// Indicate http status code error 49 | case httpError(Int) 50 | /// Indicate no response 51 | case noResponse 52 | } 53 | 54 | /// Response returned from HTTP request 55 | enum Response { 56 | case success(Data?) 57 | case failure(Error, Data?) 58 | } 59 | 60 | /// HTTP method 61 | enum Method: String { 62 | case GET, POST, PUT, PATCH, DELETE 63 | } 64 | 65 | /// MIME type used for headers like `Content-Type` or `Accept`. 66 | enum MIMEType: String { 67 | case json = "application/json" 68 | case wwwForm = "application/x-www-form-urlencoded" 69 | } 70 | 71 | /** 72 | Starts a HTTP request. 73 | 74 | - parameter urlRequest: URLRequest to perform. 75 | - parameter networkSession: NetworkSession from which starts a request. 76 | - parameter completion: contains HTTPResponse which is either `Data?` or `HTTPError` 77 | */ 78 | @discardableResult 79 | class func start(with urlRequest: URLRequest, networkSession: NetworkSession, completion: @escaping (Response) -> Void) -> URLSessionDataTask { 80 | networkSession.loadData(for: urlRequest) { (data, urlResponse, error) in 81 | if let error = error { 82 | completion(.failure(.urlError(error as? URLError), data)) 83 | return 84 | } 85 | 86 | guard let urlResponse = urlResponse as? HTTPURLResponse else { 87 | print("---- NO HTTPURLResponse") 88 | completion(.failure(.noResponse, data)) 89 | return 90 | } 91 | 92 | switch urlResponse.statusCode { 93 | case 200...299: 94 | completion(.success(data)) 95 | default: 96 | print("---- UNHANDLED STATUS CODE: \(urlResponse.statusCode)") 97 | completion(.failure(.httpError(urlResponse.statusCode), data)) 98 | } 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /Covid/Services/UserDefaultsKeys.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | // 25 | // UserDefaultsKeys.swift 26 | // Covid 27 | // 28 | // Created by Boris Kolozsi on 15/03/2020. 29 | // 30 | 31 | import Foundation 32 | import SwiftyUserDefaults 33 | 34 | extension DefaultsKeys { 35 | var didRunApp: DefaultsKey { .init("didRunApp", defaultValue: false) } 36 | var didShowForeignAlert: DefaultsKey { .init("didShowForeignAlert", defaultValue: false) } 37 | 38 | var deviceId: DefaultsKey { .init("deviceId", defaultValue: "") } 39 | var profileId: DefaultsKey { .init("profileId") } 40 | var pushToken: DefaultsKey { .init("pushToken") } 41 | var FCMToken: DefaultsKey { .init("FCMToken") } 42 | var tempPhoneNumber: DefaultsKey { .init("tempPhoneNumber") } 43 | var covidPass: DefaultsKey { .init("covidPass") } 44 | 45 | var quarantineLatitude: DefaultsKey { .init("quarantineLatitude") } 46 | var quarantineLongitude: DefaultsKey { .init("quarantineLongitude") } 47 | var quarantineAddress: DefaultsKey { .init("quarantineAddress") } 48 | var quarantineCity: DefaultsKey { .init("quarantineCity") } 49 | var quarantineStart: DefaultsKey { .init("quarantineStart") } 50 | var quarantineEnd: DefaultsKey { .init("quarantineEnd") } 51 | var quarantineActive: DefaultsKey { .init("quarantineActive", defaultValue: false) } 52 | 53 | var lastLocationUpdate: DefaultsKey { .init("lastLocationUpdate") } 54 | var lastConnectionsUpdate: DefaultsKey { .init("lastConnectionsUpdate") } 55 | 56 | var lastQuarantineUpdate: DefaultsKey { .init("lastQuarantineUpdate") } 57 | var referenceFace: DefaultsKey<[Int8]?> { .init("dot-face") } 58 | var allowVerifyFaceId: DefaultsKey { .init("face_id") } 59 | } 60 | 61 | extension Int8: DefaultsSerializable {} 62 | -------------------------------------------------------------------------------- /Covid/UI/ViewController.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | // 24 | // ViewController.swift 25 | // Covid 26 | // 27 | // Created by Boris Bielik on 20/04/2020. 28 | // Copyright © 2020 Sygic. All rights reserved. 29 | // 30 | 31 | import Foundation 32 | import UIKit 33 | 34 | class ViewController: UIViewController { 35 | 36 | var hasTransparentNavigationBar = true 37 | 38 | override func viewWillAppear(_ animated: Bool) { 39 | super.viewWillAppear(animated) 40 | 41 | navigationController?.navigationBar.setTransparent(hasTransparentNavigationBar) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Covid/WelcomeViewController.swift: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2020 Sygic 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | // 25 | // WelcomeViewController.swift 26 | // Covid 27 | // 28 | // Created by Boris Kolozsi on 12/03/2020. 29 | // 30 | 31 | import UIKit 32 | import SwiftyUserDefaults 33 | 34 | extension WelcomeViewController: HasStoryBoardIdentifier { 35 | static let storyboardIdentifier = "WelcomeViewController" 36 | } 37 | 38 | final class WelcomeViewController: ViewController { 39 | 40 | @IBOutlet private var agreeButton: UIButton! 41 | @IBOutlet private var cooperationLabel: UILabel! 42 | 43 | var onAgree: (() -> Void)? 44 | 45 | override func loadView() { 46 | super.loadView() 47 | 48 | agreeButton.layer.cornerRadius = 20 49 | agreeButton.layer.masksToBounds = true 50 | 51 | if Defaults.deviceId.isEmpty { 52 | Defaults.deviceId = UUID().uuidString 53 | } 54 | 55 | let text = "Tento projekt vznikol\nako spojenie dobrovoľnej iniciatívy\nZostanZdravy a Sygic" 56 | let attributes: [NSAttributedString.Key: Any] = [.font: UIFont(name: "Poppins-Regular", size: 15.0)!, .foregroundColor: UIColor.darkGray] 57 | let attributedString = NSMutableAttributedString(string: text, attributes: attributes) 58 | let zostanRange = (attributedString.string as NSString).range(of: "ZostanZdravy") 59 | let sygicRange = (attributedString.string as NSString).range(of: "Sygic") 60 | attributedString.setAttributes([.font: UIFont(name: "Poppins-Bold", size: 15.0)!], range: zostanRange) 61 | attributedString.setAttributes([.font: UIFont(name: "Poppins-Bold", size: 15.0)!], range: sygicRange) 62 | cooperationLabel.attributedText = attributedString 63 | } 64 | 65 | @IBAction private func agreeDidTap(_ sender: Any) { 66 | onAgree?() 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Covid/en.lproj/LaunchScreen.strings: -------------------------------------------------------------------------------- 1 | 2 | /* Class = "UILabel"; text = "Bojujme\nproti Covid-19\nspoločne"; ObjectID = "b0I-NR-ulW"; */ 3 | "b0I-NR-ulW.text" = "Bojujme\nproti Covid-19\nspoločne"; 4 | -------------------------------------------------------------------------------- /CovidTests/CovidTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CovidTests.swift 3 | // CovidTests 4 | // 5 | // Created by Boris Bielik on 02/04/2020. 6 | // Copyright © 2020 Sygic. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class CovidTests: XCTestCase { 12 | 13 | override func setUpWithError() throws { 14 | // Put setup code here. This method is called before the invocation of each test method in the class. 15 | } 16 | 17 | override func tearDownWithError() throws { 18 | // Put teardown code here. This method is called after the invocation of each test method in the class. 19 | } 20 | 21 | func testExample() throws { 22 | // This is an example of a functional test case. 23 | // Use XCTAssert and related functions to verify your tests produce the correct results. 24 | } 25 | 26 | func testPerformanceExample() throws { 27 | // This is an example of a performance test case. 28 | measure { 29 | // Put the code you want to measure the time of here. 30 | } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /CovidTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Sygic 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | platform :ios, '10.1' 3 | 4 | source 'https://github.com/CocoaPods/Specs.git' 5 | source 'https://github.com/innovatrics/innovatrics-podspecs' 6 | 7 | target 'Covid' do 8 | use_frameworks! 9 | 10 | pod 'UILabel+Copyable', '~> 2.0' 11 | pod 'SwiftyUserDefaults', '5.0.0' 12 | pod 'ReachabilitySwift', '5.0.0' 13 | pod 'JWTDecode', '~> 2.4' 14 | 15 | pod 'Firebase/Analytics'#, '6.21.0' 16 | pod 'Firebase/Crashlytics'#, '6.21.0' 17 | pod 'Firebase/RemoteConfig'#, '6.21.0' 18 | pod 'Firebase/Messaging'#, '4.3.0' 19 | 20 | pod 'dot', '2.14.5' 21 | 22 | end 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | [![Build Status](https://app.bitrise.io/app/3baabd16bba9e290.svg?token=mo_bjE8kB8bJ2h6K6wKJXA)](https://app.bitrise.io/app/3baabd16bba9e290#/buildsÂ) 4 | 5 | iOS 10.0 6 |

7 | 8 | # iOS application to help fight COVID-19 9 | 10 | 11 | 12 | This app is aiming at helping fight COVID-19 spread by collecting anonymous data about people meeting each other. 13 | 14 | In the basic scenario, the device is emitting an iBeacon signal (Bluetooth low energy) and at the same time listens to iBeacons around you. Thus creating an anonymous mesh of who met whom and when. This data is collected on server and when a person is positively diagnosed with SARS-CoV-2 (the infamous "corona" virus causing COVID-19 disease), the server will notify via push all the devices that were in a close and significant proximity with that person. 15 | 16 | Alternatively, the user can flag himself as quarantined in which case the app will regularly check his/her GPS location and warn him/her in case he/she leaves the quarantine. 17 | 18 | ## Build prerequisities 19 | 20 | * Install all required dependencies > run `pod install` 21 | * Fill in `bundle identifier` 22 | * Register your app in Google Firebase console and copy GoogleService-Info.plist file to app folder 23 | * Add innovatrics license file. You can find more about the face recognition solutions here: https://www.innovatrics.com/face-recognition-solutions/ 24 | * Save the world 25 | -------------------------------------------------------------------------------- /Vendor/SPPermissions/Data/SPPermissionsColor.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // Copyright © 2019 Ivan Varabei (varabeis@icloud.com) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in all 12 | // copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | // SOFTWARE. 21 | 22 | import UIKit 23 | 24 | enum SPPermissionsColor { 25 | 26 | static var base: UIColor { 27 | return UIColor.systemBlue 28 | } 29 | 30 | static var black: UIColor { 31 | return UIColor.black 32 | } 33 | 34 | static var white: UIColor { 35 | return UIColor.white 36 | } 37 | 38 | static var systemBackground: UIColor { 39 | #if os(iOS) 40 | if #available(iOS 13.0, *) { 41 | return UIColor.systemBackground 42 | } 43 | #endif 44 | return UIColor.white 45 | } 46 | 47 | static var secondarySystemBackground: UIColor { 48 | #if os(iOS) 49 | if #available(iOS 13.0, *) { 50 | return UIColor.secondarySystemBackground 51 | } 52 | #endif 53 | return UIColor(red: 242/255, green: 242/255, blue: 247/255, alpha: 1) 54 | } 55 | 56 | static var separator: UIColor { 57 | if #available(iOS 13.0, tvOS 13.0, *) { 58 | return UIColor.separator 59 | } else { 60 | return UIColor(red: 60/255, green: 60/255, blue: 67/255, alpha: 1) 61 | } 62 | } 63 | 64 | static var label: UIColor { 65 | if #available(iOS 13.0, tvOS 13.0, *) { 66 | return UIColor.label 67 | } else { 68 | return UIColor.black 69 | } 70 | } 71 | 72 | static var secondaryLabel: UIColor { 73 | if #available(iOS 13.0, tvOS 13.0, *) { 74 | return UIColor.secondaryLabel 75 | } else { 76 | return UIColor(red: 138/255, green: 138/255, blue: 142/255, alpha: 1) 77 | } 78 | } 79 | 80 | static var buttonArea: UIColor { 81 | if #available(iOS 13.0, tvOS 13.0, *) { 82 | return UIColor { (traits) -> UIColor in 83 | return traits.userInterfaceStyle == .dark ? UIColor(red: 61/255, green: 62/255, blue: 66/255, alpha: 1) : 84 | UIColor(red: 238/255, green: 238/255, blue: 240/255, alpha: 1) 85 | } 86 | } else { 87 | return UIColor(red: 238/255, green: 238/255, blue: 240/255, alpha: 1) 88 | } 89 | } 90 | } 91 | 92 | -------------------------------------------------------------------------------- /Vendor/SPPermissions/Data/SPPermissionsDelay.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // Copyright © 2019 Ivan Varabei (varabeis@icloud.com) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in all 12 | // copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | // SOFTWARE. 21 | 22 | import UIKit 23 | 24 | enum SPPermissionsDelay { 25 | 26 | public static func wait(_ delay: Double, closure: @escaping ()->()) { 27 | let when = DispatchTime.now() + delay 28 | DispatchQueue.main.asyncAfter(deadline: when) { 29 | closure() 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Vendor/SPPermissions/Data/SPPermissionsHaptic.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // Copyright © 2019 Ivan Varabei (varabeis@icloud.com) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in all 12 | // copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | // SOFTWARE. 21 | 22 | import UIKit 23 | 24 | enum SPPermissionsHaptic { 25 | 26 | 27 | static func impact(_ style: Style) { 28 | #if os(iOS) 29 | switch style { 30 | case .light: 31 | let generator = UIImpactFeedbackGenerator(style: .light) 32 | generator.impactOccurred() 33 | case .medium: 34 | let generator = UIImpactFeedbackGenerator(style: .medium) 35 | generator.impactOccurred() 36 | case .heavy: 37 | let generator = UIImpactFeedbackGenerator(style: .heavy) 38 | generator.impactOccurred() 39 | case .success: 40 | let generator = UINotificationFeedbackGenerator() 41 | generator.notificationOccurred(UINotificationFeedbackGenerator.FeedbackType.success) 42 | case .warning: 43 | let generator = UINotificationFeedbackGenerator() 44 | generator.notificationOccurred(UINotificationFeedbackGenerator.FeedbackType.warning) 45 | case .error: 46 | let generator = UINotificationFeedbackGenerator() 47 | generator.notificationOccurred(UINotificationFeedbackGenerator.FeedbackType.error) 48 | } 49 | #endif 50 | } 51 | 52 | enum Style { 53 | 54 | case light 55 | case medium 56 | case heavy 57 | case error 58 | case success 59 | case warning 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Vendor/SPPermissions/Data/SPPermissionsOpener.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // Copyright © 2019 Ivan Varabei (varabeis@icloud.com) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in all 12 | // copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | // SOFTWARE. 21 | 22 | import UIKit 23 | 24 | enum SPPermissionsOpener { 25 | 26 | static func openSettings() { 27 | DispatchQueue.main.async { 28 | guard let settingsUrl = URL(string: UIApplication.openSettingsURLString) else { 29 | return 30 | } 31 | 32 | if UIApplication.shared.canOpenURL(settingsUrl) { 33 | if #available(iOS 10.0, *) { 34 | UIApplication.shared.open(settingsUrl, completionHandler: { (success) in 35 | print("SPApp - Settings opened: \(success)") 36 | }) 37 | } else { 38 | UIApplication.shared.openURL(settingsUrl as URL) 39 | } 40 | } else { 41 | print("SPApp - Settings not opened") 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Vendor/SPPermissions/Data/SPPermissionsText.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // Copyright © 2019 Ivan Varabei (varabeis@icloud.com) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in all 12 | // copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | // SOFTWARE. 21 | 22 | import UIKit 23 | 24 | enum SPPermissionsText { 25 | 26 | static func name(for permission: SPPermission) -> String { 27 | switch permission { 28 | #if os(iOS) 29 | case .camera: 30 | return "Camera" 31 | case .photoLibrary: 32 | return "Photo Library" 33 | case .microphone: 34 | return "Microphone" 35 | case .calendar: 36 | return "Calendar" 37 | case .contacts: 38 | return "Contacts" 39 | case .reminders: 40 | return "Reminders" 41 | case .speech: 42 | return "Speech" 43 | case .locationAlwaysAndWhenInUse: 44 | return "Lokalizačné služby" 45 | case .motion: 46 | return "Motion" 47 | case .mediaLibrary: 48 | return "Media Library" 49 | case .bluetooth: 50 | return "Bluetooth" 51 | #endif 52 | case .notification: 53 | return "Notifikácie" 54 | case .locationWhenInUse: 55 | return "Location When Use" 56 | } 57 | } 58 | 59 | static func description(for permission: SPPermission) -> String { 60 | switch permission { 61 | #if os(iOS) 62 | case .camera: 63 | return "Allow app for use camera" 64 | case .calendar: 65 | return "Application can add events to calendar" 66 | case .contacts: 67 | return "Access for your contacts and phones" 68 | case .microphone: 69 | return "Allow record voice from app" 70 | case .photoLibrary: 71 | return "Access for save photos in your gallery" 72 | case .reminders: 73 | return "Application can create new task" 74 | case .speech: 75 | return "Allow to check your voice" 76 | case .locationAlwaysAndWhenInUse: 77 | return "" 78 | case .motion: 79 | return "Allow to report motion and environment-related data" 80 | case .mediaLibrary: 81 | return "Allow to check your media" 82 | case .bluetooth: 83 | return ""//"Allow access to bluetooth" 84 | #endif 85 | case .notification: 86 | return "" //"Get important information without opening app." 87 | case .locationWhenInUse: 88 | return "Allow to access your location" 89 | } 90 | } 91 | 92 | static var titleText: String = "Need Permissions" 93 | static var subtitleText: String = "These are the permissions the app requires to work properly. Please see description for each permission." 94 | static var subtitleShortText: String = "Permissions request" 95 | static var commentText: String = "Permissions are necessary for the application to work and perform correctly. Push are not required permissions." 96 | 97 | static var allow: String = "Povoliť" 98 | static var allowed: String = "Povolené" 99 | } 100 | -------------------------------------------------------------------------------- /Vendor/SPPermissions/Interface/Dialog/Views/SPPermissionsDialogFooterCommentView.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // Copyright © 2019 Ivan Varabei (varabeis@icloud.com) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in all 12 | // copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | // SOFTWARE. 21 | 22 | import UIKit 23 | 24 | #if os(iOS) 25 | class SPPermissionsDialogFooterCommentView: UITableViewHeaderFooterView { 26 | 27 | let titleLabel = UILabel() 28 | static var id = "SPPermissionsDialogFooterCommentView" 29 | 30 | override init(reuseIdentifier: String?) { 31 | super.init(reuseIdentifier: reuseIdentifier) 32 | titleLabel.numberOfLines = 0 33 | titleLabel.font = UIFont.systemFont(ofSize: 11, weight: .regular) 34 | titleLabel.textColor = SPPermissionsColor.secondaryLabel.withAlphaComponent(0.5) 35 | titleLabel.translatesAutoresizingMaskIntoConstraints = false 36 | contentView.addSubview(titleLabel) 37 | titleLabel.leadingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.leadingAnchor).isActive = true 38 | titleLabel.trailingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.trailingAnchor).isActive = true 39 | titleLabel.topAnchor.constraint(equalTo: contentView.layoutMarginsGuide.topAnchor, constant: 2).isActive = true 40 | titleLabel.bottomAnchor.constraint(equalTo: contentView.layoutMarginsGuide.bottomAnchor).isActive = true 41 | 42 | if #available(iOS 11.0, *) { 43 | insetsLayoutMarginsFromSafeArea = false 44 | } else { 45 | // Fallback on earlier versions 46 | } 47 | if #available(iOS 11.0, *) { 48 | contentView.insetsLayoutMarginsFromSafeArea = false 49 | } else { 50 | // Fallback on earlier versions 51 | } 52 | } 53 | 54 | required init?(coder: NSCoder) { 55 | fatalError("init(coder:) has not been implemented") 56 | } 57 | } 58 | #endif 59 | -------------------------------------------------------------------------------- /Vendor/SPPermissions/Interface/List/Views/SPPermissionsListFooterCommentView.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // Copyright © 2019 Ivan Varabei (varabeis@icloud.com) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in all 12 | // copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | // SOFTWARE. 21 | 22 | import UIKit 23 | 24 | #if os(iOS) 25 | class SPPermissionsListFooterCommentView: UITableViewHeaderFooterView { 26 | 27 | /** 28 | Title for footer. 29 | */ 30 | let titleLabel = UILabel() 31 | 32 | /** 33 | ID for register in table view. 34 | */ 35 | static var id = "SPPermissionsListFooterCommentView" 36 | 37 | override init(reuseIdentifier: String?) { 38 | super.init(reuseIdentifier: reuseIdentifier) 39 | titleLabel.numberOfLines = 0 40 | titleLabel.font = UIFont.systemFont(ofSize: 14, weight: .regular) 41 | titleLabel.textColor = SPPermissionsColor.secondaryLabel 42 | titleLabel.translatesAutoresizingMaskIntoConstraints = false 43 | contentView.addSubview(titleLabel) 44 | titleLabel.leadingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.leadingAnchor).isActive = true 45 | titleLabel.trailingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.trailingAnchor).isActive = true 46 | titleLabel.topAnchor.constraint(equalTo: contentView.layoutMarginsGuide.topAnchor, constant: 3).isActive = true 47 | titleLabel.bottomAnchor.constraint(equalTo: contentView.layoutMarginsGuide.bottomAnchor).isActive = true 48 | } 49 | 50 | required init?(coder: NSCoder) { 51 | fatalError("init(coder:) has not been implemented") 52 | } 53 | } 54 | #endif 55 | -------------------------------------------------------------------------------- /Vendor/SPPermissions/Interface/List/Views/SPPermissionsListHeaderView.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // Copyright © 2019 Ivan Varabei (varabeis@icloud.com) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in all 12 | // copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | // SOFTWARE. 21 | 22 | import UIKit 23 | 24 | #if os(iOS) 25 | class SPPermissionsListHeaderView: UITableViewHeaderFooterView { 26 | 27 | /** 28 | Text for header view. 29 | */ 30 | let titleLabel = UILabel() 31 | 32 | /** 33 | ID for register in table view. 34 | */ 35 | static var id = "SPPermissionsListHeaderView" 36 | 37 | override init(reuseIdentifier: String?) { 38 | super.init(reuseIdentifier: reuseIdentifier) 39 | titleLabel.numberOfLines = 0 40 | titleLabel.font = UIFont.systemFont(ofSize: 17, weight: .regular) 41 | titleLabel.textColor = SPPermissionsColor.secondaryLabel 42 | titleLabel.translatesAutoresizingMaskIntoConstraints = false 43 | addSubview(titleLabel) 44 | titleLabel.leadingAnchor.constraint(equalTo: layoutMarginsGuide.leadingAnchor).isActive = true 45 | titleLabel.trailingAnchor.constraint(equalTo: layoutMarginsGuide.trailingAnchor).isActive = true 46 | titleLabel.topAnchor.constraint(equalTo: layoutMarginsGuide.topAnchor, constant: -2).isActive = true 47 | titleLabel.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -25).isActive = true 48 | } 49 | 50 | required init?(coder: NSCoder) { 51 | fatalError("init(coder:) has not been implemented") 52 | } 53 | } 54 | #endif 55 | -------------------------------------------------------------------------------- /Vendor/SPPermissions/Interface/Native/SPPermissionsNativeController.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // Copyright © 2019 Ivan Varabei (varabeis@icloud.com) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in all 12 | // copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | // SOFTWARE. 21 | 22 | import UIKit 23 | 24 | /** 25 | Controller for native interface. 26 | Not have DataSource, but you can customize alert about denied permission in `delegate`. 27 | */ 28 | public class SPPermissionsNativeController: NSObject, SPPermissionsControllerProtocol { 29 | 30 | public weak var delegate: SPPermissionsDelegate? 31 | 32 | private var permissions: [SPPermission] 33 | 34 | init(_ permissions: [SPPermission]) { 35 | self.permissions = permissions 36 | super.init() 37 | } 38 | 39 | /** 40 | Call this method for present controller on other controller. In this method controller configure. 41 | 42 | - parameter controller: Controller, on which need present `SPPermissions` controller. Using for alert. 43 | - warning: `didHide` delegate method not call here. 44 | */ 45 | public func present(on controller: UIViewController) { 46 | let delegate = self.delegate 47 | for permission in permissions { 48 | permission.request { 49 | if permission.isAuthorized { 50 | delegate?.didAllow?(permission: permission) 51 | } else { 52 | delegate?.didDenied?(permission: permission) 53 | 54 | /** 55 | Show alert with propose go to settings and allow permission. 56 | For disable it implement protocol `SPPermissionsDelegate`. 57 | */ 58 | if permission.isDenied { 59 | var data = SPPermissionDeniedAlertData() 60 | if delegate != nil { 61 | guard let userData = delegate?.deniedData?(for: permission) else { return } 62 | data = userData 63 | } 64 | let alertController = UIAlertController.init( 65 | title: data.alertOpenSettingsDeniedPermissionTitle, 66 | message: data.alertOpenSettingsDeniedPermissionDescription, 67 | preferredStyle: .alert 68 | ) 69 | alertController.addAction(UIAlertAction.init( 70 | title: data.alertOpenSettingsDeniedPermissionCancelTitle, 71 | style: UIAlertAction.Style.cancel, 72 | handler: nil) 73 | ) 74 | alertController.addAction(UIAlertAction.init( 75 | title: data.alertOpenSettingsDeniedPermissionButtonTitle, 76 | style: UIAlertAction.Style.default, 77 | handler: { (action) in 78 | SPPermissionsOpener.openSettings() 79 | })) 80 | controller.present(alertController, animated: true, completion: nil) 81 | } 82 | } 83 | } 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /Vendor/SPPermissions/Interface/Shared/Buttons/SPPermissionsCloseButton.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // Copyright © 2019 Ivan Varabei (varabeis@icloud.com) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in all 12 | // copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | // SOFTWARE. 21 | 22 | import UIKit 23 | 24 | #if os(iOS) 25 | class SPPermissionsCloseButton: UIButton { 26 | 27 | /** 28 | Draw close icon. 29 | */ 30 | let iconView = CloseIconView() 31 | 32 | init() { 33 | super.init(frame: .zero) 34 | backgroundColor = .clear 35 | iconView.backgroundColor = .clear 36 | iconView.isUserInteractionEnabled = false 37 | addSubview(iconView) 38 | } 39 | 40 | required init?(coder: NSCoder) { 41 | fatalError("init(coder:) has not been implemented") 42 | } 43 | 44 | override func layoutSubviews() { 45 | super.layoutSubviews() 46 | iconView.frame = bounds 47 | } 48 | 49 | /** 50 | Drawable close icon. 51 | */ 52 | class CloseIconView: UIView { 53 | 54 | /** 55 | Color of icon. 56 | */ 57 | var elementColor: UIColor = SPPermissionsColor.secondaryLabel 58 | 59 | /** 60 | Background color. 61 | */ 62 | var areaColor: UIColor = SPPermissionsColor.secondarySystemBackground 63 | 64 | override func draw(_ rect: CGRect) { 65 | SPPermissionsDraw.drawClose(frame: rect, resizing: .aspectFit, background: areaColor, element: elementColor) 66 | } 67 | } 68 | } 69 | #endif 70 | -------------------------------------------------------------------------------- /Vendor/SPPermissions/Interface/Shared/Labels/SPPermissionsLabel.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // Copyright © 2019 Ivan Varabei (varabeis@icloud.com) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in all 12 | // copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | // SOFTWARE. 21 | 22 | import UIKit 23 | 24 | #if os(iOS) 25 | /** 26 | Layout with dinamic height. For it call `layout()`. 27 | */ 28 | class SPPermissionsLabel: UILabel { 29 | 30 | func layout(x: CGFloat, y: CGFloat, width: CGFloat) { 31 | frame = CGRect.init(x: frame.origin.x, y: frame.origin.y, width: width, height: frame.height) 32 | sizeToFit() 33 | frame = CGRect.init(x: frame.origin.x, y: frame.origin.y, width: width, height: frame.height) 34 | frame.origin = CGPoint.init(x: x, y: y) 35 | } 36 | } 37 | #endif 38 | -------------------------------------------------------------------------------- /Vendor/SPPermissions/Interface/Shared/Other/SPPermissionIconView.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // Copyright © 2019 Ivan Varabei (varabeis@icloud.com) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in all 12 | // copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | // SOFTWARE. 21 | 22 | import UIKit 23 | 24 | #if os(iOS) 25 | /** 26 | Draw with code icon for permission. 27 | */ 28 | public class SPPermissionIconView: UIView { 29 | 30 | /** 31 | Icon for this permission draw in view. 32 | */ 33 | var permission: SPPermission { didSet { self.setNeedsDisplay() } } 34 | 35 | /** 36 | Color if icon. 37 | */ 38 | public var color = SPPermissionsColor.base { didSet { self.setNeedsDisplay() } } 39 | 40 | init(_ permission: SPPermission) { 41 | self.permission = permission 42 | super.init(frame: CGRect.zero) 43 | self.backgroundColor = UIColor.clear 44 | } 45 | 46 | required init?(coder: NSCoder) { 47 | fatalError("init(coder:) has not been implemented") 48 | } 49 | 50 | /** 51 | Using draw with code. No images. 52 | */ 53 | override public func draw(_ rect: CGRect) { 54 | super.draw(rect) 55 | switch permission { 56 | case .camera: 57 | SPPermissionsDraw.drawCamera(frame: rect, resizing: .aspectFit, color: color) 58 | case .photoLibrary: 59 | SPPermissionsDraw.drawPhotos(frame: rect, resizing: .aspectFit, color: color) 60 | case .notification: 61 | SPPermissionsDraw.drawNotifications(frame: rect, resizing: .aspectFit, color: color) 62 | case .microphone: 63 | SPPermissionsDraw.drawMicrophone(frame: rect, resizing: .aspectFit, color: color) 64 | case .calendar: 65 | SPPermissionsDraw.drawCalendar(frame: rect, resizing: .aspectFit, color: color) 66 | case .contacts: 67 | SPPermissionsDraw.drawContacts(frame: rect, resizing: .aspectFit, color: color) 68 | case .reminders: 69 | SPPermissionsDraw.drawReminders(frame: rect, resizing: .aspectFit, color: color) 70 | case .speech: 71 | SPPermissionsDraw.drawSpeech(frame: rect, resizing: .aspectFit, color: color) 72 | case .locationWhenInUse: 73 | SPPermissionsDraw.drawLocations(frame: rect, resizing: .aspectFit, color: color) 74 | case .locationAlwaysAndWhenInUse: 75 | SPPermissionsDraw.drawLocations(frame: rect, resizing: .aspectFit, color: color) 76 | case .motion: 77 | SPPermissionsDraw.drawMotion(frame: rect, resizing: .aspectFit, color: color) 78 | case .mediaLibrary: 79 | SPPermissionsDraw.drawMedia(frame: rect, resizing: .aspectFit, color: color) 80 | case .bluetooth: 81 | SPPermissionsDraw.drawBluetooth(frame: rect, resizing: .aspectFit, color: color) 82 | } 83 | } 84 | } 85 | #endif 86 | -------------------------------------------------------------------------------- /Vendor/SPPermissions/Interface/Shared/Other/SPPermissionsGradeBlurView.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // Copyright © 2019 Ivan Varabei (varabeis@icloud.com) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in all 12 | // copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | // SOFTWARE. 21 | 22 | import UIKit 23 | 24 | #if os(iOS) 25 | class SPPermissionsGradeBlurView: UIView { 26 | 27 | private var gradeView: UIView = UIView() 28 | private var blurView: UIView = UIView() 29 | 30 | init() { 31 | super.init(frame: CGRect.zero) 32 | backgroundColor = .clear 33 | setGradeColor(SPPermissionsColor.black) 34 | setGradeAlpha(0) 35 | setBlurRadius(0) 36 | commonInit() 37 | } 38 | 39 | required init?(coder aDecoder: NSCoder) { 40 | fatalError("init(coder:) has not been implemented") 41 | } 42 | 43 | private func commonInit() { 44 | blurView = SPPermissionsBlurView() 45 | layer.masksToBounds = true 46 | addSubview(gradeView) 47 | addSubview(blurView) 48 | } 49 | 50 | func setGradeColor(_ color: UIColor) { 51 | gradeView.backgroundColor = UIColor.black 52 | } 53 | 54 | func setGradeAlpha(_ alpha: CGFloat) { 55 | gradeView.alpha = alpha 56 | } 57 | 58 | func setBlurRadius(_ radius: CGFloat) { 59 | if let blurView = self.blurView as? SPPermissionsBlurView { 60 | blurView.setBlurRadius(radius) 61 | } 62 | } 63 | 64 | override func layoutSubviews() { 65 | super.layoutSubviews() 66 | gradeView.frame = bounds 67 | blurView.frame = bounds 68 | } 69 | } 70 | 71 | public class SPPermissionsBlurView: UIVisualEffectView { 72 | 73 | private let blurEffect: UIBlurEffect 74 | open var blurRadius: CGFloat { 75 | return blurEffect.value(forKeyPath: "blurRadius") as! CGFloat 76 | } 77 | 78 | public convenience init() { 79 | self.init(withRadius: 0) 80 | } 81 | 82 | public init(withRadius radius: CGFloat) { 83 | let customBlurClass: AnyObject.Type = NSClassFromString("_UICustomBlurEffect")! 84 | let customBlurObject: NSObject.Type = customBlurClass as! NSObject.Type 85 | self.blurEffect = customBlurObject.init() as! UIBlurEffect 86 | self.blurEffect.setValue(1.0, forKeyPath: "scale") 87 | self.blurEffect.setValue(radius, forKeyPath: "blurRadius") 88 | super.init(effect: radius == 0 ? nil : self.blurEffect) 89 | } 90 | 91 | required public init?(coder aDecoder: NSCoder) { 92 | fatalError("init(coder:) has not been implemented") 93 | } 94 | 95 | open func setBlurRadius(_ radius: CGFloat) { 96 | guard radius != blurRadius else { return } 97 | blurEffect.setValue(radius, forKeyPath: "blurRadius") 98 | self.effect = blurEffect 99 | } 100 | } 101 | #endif 102 | -------------------------------------------------------------------------------- /Vendor/SPPermissions/Models/SPPermissionDeniedAlertData.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // Copyright © 2019 Ivan Varabei (varabeis@icloud.com) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in all 12 | // copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | // SOFTWARE. 21 | 22 | import UIKit 23 | 24 | /** 25 | If permission denied, after action show alert with propose open settings and allow this permission. 26 | */ 27 | public class SPPermissionDeniedAlertData: NSObject { 28 | 29 | /** 30 | Title of alert. 31 | */ 32 | public var alertOpenSettingsDeniedPermissionTitle: String = "Povoľte službu" 33 | 34 | /** 35 | Subtitle of alert. 36 | */ 37 | public var alertOpenSettingsDeniedPermissionDescription: String = "Povoľte službu vo Vašich Nastaveniach" 38 | 39 | /** 40 | Title of action button. 41 | */ 42 | public var alertOpenSettingsDeniedPermissionButtonTitle: String = "Otvoriť Nastavenia" 43 | 44 | /** 45 | Title of cancel button. 46 | */ 47 | public var alertOpenSettingsDeniedPermissionCancelTitle: String = "Zavrieť" 48 | } 49 | -------------------------------------------------------------------------------- /Vendor/SPPermissions/Permissions/SPBluetoothPermission.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // Copyright © 2019 Ivan Varabei (varabeis@icloud.com) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in all 12 | // copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | // SOFTWARE. 21 | 22 | #if os(iOS) 23 | 24 | import UIKit 25 | import CoreBluetooth 26 | 27 | struct SPBluetoothPermission: SPPermissionProtocol { 28 | 29 | var isAuthorized: Bool { 30 | if #available(iOS 13.0, *) { 31 | return CBCentralManager().authorization == .allowedAlways 32 | } 33 | return CBPeripheralManager.authorizationStatus() == .authorized 34 | } 35 | 36 | var isDenied: Bool { 37 | if #available(iOS 13.0, *) { 38 | return CBCentralManager().authorization == .denied 39 | } 40 | return CBPeripheralManager.authorizationStatus() == .denied 41 | } 42 | 43 | func request(completion: @escaping ()->()?) { 44 | fatalError("SPPerission - Request for Bluetooth not implement, if you know how add request, paste code here and create pull request. Also you can write me, I add code manually. Thanks!") 45 | } 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /Vendor/SPPermissions/Permissions/SPLocationPermission.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // Copyright © 2019 Ivan Varabei (varabeis@icloud.com) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in all 12 | // copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | // SOFTWARE. 21 | 22 | import UIKit 23 | import MapKit 24 | 25 | struct SPLocationPermission: SPPermissionProtocol { 26 | 27 | var type: SPLocationType 28 | 29 | enum SPLocationType { 30 | case WhenInUse 31 | #if os(iOS) 32 | case AlwaysAndWhenInUse 33 | #endif 34 | } 35 | 36 | init(type: SPLocationType) { 37 | self.type = type 38 | } 39 | 40 | var isAuthorized: Bool { 41 | let status = CLLocationManager.authorizationStatus() 42 | if status == .authorizedAlways || status == .authorizedWhenInUse { 43 | return true 44 | } else { 45 | if type == .WhenInUse { 46 | return status == .authorizedWhenInUse 47 | } else { 48 | return false 49 | } 50 | } 51 | } 52 | 53 | var isDenied: Bool { 54 | let authorizationStatus = CLLocationManager.authorizationStatus() 55 | return authorizationStatus == .denied || authorizationStatus == .restricted 56 | } 57 | 58 | func request(completion: @escaping ()->()?) { 59 | 60 | switch self.type { 61 | #if os(iOS) 62 | case .AlwaysAndWhenInUse: 63 | if SPPermissionAlwaysAuthorizationLocationHandler.shared == nil { 64 | SPPermissionAlwaysAuthorizationLocationHandler.shared = SPPermissionAlwaysAuthorizationLocationHandler() 65 | } 66 | 67 | SPPermissionAlwaysAuthorizationLocationHandler.shared!.requestPermission { (authorized) in 68 | DispatchQueue.main.async { 69 | completion() 70 | SPPermissionAlwaysAuthorizationLocationHandler.shared = nil 71 | } 72 | } 73 | break 74 | #endif 75 | case .WhenInUse: 76 | if SPPermissionWhenInUseAuthorizationLocationHandler.shared == nil { 77 | SPPermissionWhenInUseAuthorizationLocationHandler.shared = SPPermissionWhenInUseAuthorizationLocationHandler() 78 | } 79 | 80 | SPPermissionWhenInUseAuthorizationLocationHandler.shared!.requestPermission { (authorized) in 81 | DispatchQueue.main.async { 82 | completion() 83 | SPPermissionWhenInUseAuthorizationLocationHandler.shared = nil 84 | } 85 | } 86 | break 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /Vendor/SPPermissions/Permissions/SPNotificationPermission.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // Copyright © 2019 Ivan Varabei (varabeis@icloud.com) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in all 12 | // copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | // SOFTWARE. 21 | 22 | import UIKit 23 | import UserNotifications 24 | 25 | struct SPNotificationPermission: SPPermissionProtocol { 26 | 27 | var isAuthorized: Bool { 28 | guard let authorizationStatus = fetchAuthorizationStatus() else { return false } 29 | return authorizationStatus == .authorized 30 | } 31 | 32 | var isDenied: Bool { 33 | guard let authorizationStatus = fetchAuthorizationStatus() else { return false } 34 | return authorizationStatus == .denied 35 | } 36 | 37 | private func fetchAuthorizationStatus() -> UNAuthorizationStatus? { 38 | var notificationSettings: UNNotificationSettings? 39 | let semaphore = DispatchSemaphore(value: 0) 40 | 41 | DispatchQueue.global().async { 42 | UNUserNotificationCenter.current().getNotificationSettings { setttings in 43 | notificationSettings = setttings 44 | semaphore.signal() 45 | } 46 | } 47 | 48 | semaphore.wait() 49 | return notificationSettings?.authorizationStatus 50 | } 51 | 52 | func request(completion: @escaping ()->()?) { 53 | if #available(iOS 10.0, tvOS 10.0, *) { 54 | let center = UNUserNotificationCenter.current() 55 | center.requestAuthorization(options:[.badge, .alert, .sound]) { (granted, error) in 56 | DispatchQueue.main.async { 57 | completion() 58 | } 59 | } 60 | } else { 61 | #if os(iOS) 62 | UIApplication.shared.registerUserNotificationSettings(UIUserNotificationSettings(types: [.badge, .sound, .alert], categories: nil)) 63 | #endif 64 | DispatchQueue.main.async { 65 | completion() 66 | } 67 | } 68 | 69 | UIApplication.shared.registerForRemoteNotifications() 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Vendor/SPPermissions/Protocols/SPPermissionProtocol.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // Copyright © 2019 Ivan Varabei (varabeis@icloud.com) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in all 12 | // copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | // SOFTWARE. 21 | 22 | import UIKit 23 | 24 | /** 25 | Requerid methods and property for permission class. 26 | */ 27 | protocol SPPermissionProtocol { 28 | 29 | /** 30 | Returned if permission authorized. 31 | */ 32 | var isAuthorized: Bool { get } 33 | 34 | /** 35 | Return if permission denied. 36 | */ 37 | var isDenied: Bool { get } 38 | 39 | /** 40 | Request permission. 41 | 42 | - parameter complection: Call after permission request complete. 43 | */ 44 | func request(completion: @escaping ()->()?) 45 | } 46 | -------------------------------------------------------------------------------- /Vendor/SPPermissions/Protocols/SPPermissionsControllerProtocol.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // Copyright © 2019 Ivan Varabei (varabeis@icloud.com) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in all 12 | // copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | // SOFTWARE. 21 | 22 | import UIKit 23 | 24 | /** 25 | Requerid methods for presenter, usually it subsclass of `UIViewController`. 26 | */ 27 | protocol SPPermissionsControllerProtocol { 28 | 29 | /** 30 | Detect some event. Also can customize alert about denied permission. 31 | */ 32 | var delegate: SPPermissionsDelegate? { get set } 33 | 34 | /** 35 | Run request permission now. 36 | */ 37 | func present(on controller: UIViewController) 38 | } 39 | -------------------------------------------------------------------------------- /Vendor/SPPermissions/Protocols/SPPermissionsDataSource.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // Copyright © 2019 Ivan Varabei (varabeis@icloud.com) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in all 12 | // copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | // SOFTWARE. 21 | 22 | import UIKit 23 | 24 | #if os(iOS) 25 | /** 26 | Implement it for customize permission name, description, icon and other. 27 | */ 28 | public protocol SPPermissionsDataSource: class { 29 | 30 | /** 31 | Configure cell here. Soon add description for each property. 32 | */ 33 | func configure(_ cell: SPPermissionTableViewCell, for permission: SPPermission) -> SPPermissionTableViewCell 34 | } 35 | #endif 36 | -------------------------------------------------------------------------------- /Vendor/SPPermissions/Protocols/SPPermissionsDelegate.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // Copyright © 2019 Ivan Varabei (varabeis@icloud.com) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in all 12 | // copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | // SOFTWARE. 21 | 22 | import UIKit 23 | 24 | /** 25 | List of events methods. All optional. 26 | */ 27 | @objc public protocol SPPermissionsDelegate: class { 28 | 29 | /** 30 | Call when permission allowed. 31 | 32 | - parameter permission: Which permission did allowed. 33 | */ 34 | @objc optional func didAllow(permission: SPPermission) 35 | 36 | /** 37 | Call when permission denied. 38 | 39 | - parameter permission: Which permission did denied. 40 | */ 41 | @objc optional func didDenied(permission: SPPermission) 42 | 43 | /** 44 | Call when controller closed. 45 | 46 | - parameter ids: IDs permissions which showed in this controller. Also include permisssions, which not requested. 47 | No way pass array of `SPPermission` becouse array of enum can't represented in objc. 48 | */ 49 | @objc optional func didHide(permissions ids: [Int]) 50 | 51 | /** 52 | If permission denied, after action show alert with propose open settings and allow this permission. 53 | 54 | - parameter permission: Denied data for this permission. 55 | */ 56 | @objc optional func deniedData(for permission: SPPermission) -> SPPermissionDeniedAlertData? 57 | } 58 | -------------------------------------------------------------------------------- /Vendor/SPPermissions/SPPermissions.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // Copyright © 2019 Ivan Varabei (varabeis@icloud.com) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in all 12 | // copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | // SOFTWARE. 21 | 22 | import UIKit 23 | 24 | public enum SPPermissions { 25 | 26 | /** 27 | Request all permissions by each and with native dialog. Force mode. Show alert if permission denied. 28 | 29 | - parameter permissions: List of permissions for request. 30 | */ 31 | public static func native(_ permissions: [SPPermission]) -> SPPermissionsNativeController { 32 | let controller = SPPermissionsNativeController(removeDublicates(permissions)) 33 | return controller 34 | } 35 | 36 | #if os(iOS) 37 | /** 38 | Request permissions as list in modal controller. In iPad open as `formSheet`. 39 | 40 | - warning: Not present it from parent controller method. Use in class method `present(on:)`. 41 | - parameter permissions: List of permissions for request. 42 | - returns: Controller for configure texts. Ready for present. 43 | */ 44 | public static func list(_ permissions: [SPPermission]) -> SPPermissionsListController { 45 | let controller = SPPermissionsListController(removeDublicates(permissions)) 46 | return controller 47 | } 48 | 49 | /** 50 | Request permissions as dialog. Available swipe-down for dismiss. 51 | 52 | - warning: Not present it from parent controller method. Use in class method `present(on:)`. 53 | - parameter permissions: List of permissions for request. 54 | - returns: Controller for configure data. Ready for present. 55 | */ 56 | public static func dialog(_ permissions: [SPPermission]) -> SPPermissionsDialogController { 57 | let controller = SPPermissionsDialogController(removeDublicates(permissions)) 58 | return controller 59 | } 60 | #endif 61 | 62 | /** 63 | Remove dublicates permissions if added as mistake. 64 | 65 | - parameter permissions: List permissions for uniquary. 66 | */ 67 | private static func removeDublicates(_ permissions: [SPPermission]) -> [SPPermission] { 68 | var result = [SPPermission]() 69 | for permission in permissions { 70 | if !result.contains(permission) { result.append(permission) } 71 | } 72 | return result 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /settings_version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #@AUTHOR Boris Bielik 4 | #@VERSION v1.0 5 | 6 | function printHelp { 7 | echo "-p specify name of the plist" 8 | echo "-h, -help show brief help" 9 | exit 0 10 | } 11 | 12 | PLIST_PATH="" 13 | 14 | while test $# -gt 0; do 15 | case "$1" in 16 | -h|-help) 17 | printHelp 18 | ;; 19 | 20 | #plist path 21 | -p) 22 | if [ -z "$2" ]; then 23 | echo "No parameter was specified. Exiting..." 24 | exit 1; 25 | fi 26 | 27 | PLIST_PATH=$2 28 | shift 2 29 | ;; 30 | *) 31 | break;; 32 | esac 33 | done 34 | 35 | version=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${PLIST_PATH}") 36 | version_build="$version (${CURRENT_PROJECT_VERSION})" 37 | settings_bundle_path="$SRCROOT/Covid/Resources/Settings.bundle/Root.plist" 38 | 39 | echo "Copying ${version_build} from ${PLIST_PATH} to ${settings_bundle_path}." 40 | /usr/libexec/PlistBuddy -c "Set :PreferenceSpecifiers:1:DefaultValue $version_build" "${settings_bundle_path}" 41 | --------------------------------------------------------------------------------