diff --git a/Package.swift b/Package.swift index b9f2f9b..f45da88 100644 --- a/Package.swift +++ b/Package.swift @@ -84,9 +84,6 @@ let package = Package( targets: [ .target( name: "PermissionsKit", - resources: [ - .process("Resources") - ], swiftSettings: [ .define("PERMISSIONSKIT_SPM") ] diff --git a/PermissionsKit.podspec b/PermissionsKit.podspec index 5ae6959..39ee6fb 100644 --- a/PermissionsKit.podspec +++ b/PermissionsKit.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "PermissionsKit" - s.version = "8.0.0" + s.version = "9.0.0" s.summary = "Ask permissions with ready-use interface. You can check status permission and if it has been requested before. Support SwiftUI." s.homepage = "https://github.com/sparrowcode/PermissionsKit" s.source = { :git => "https://github.com/sparrowcode/PermissionsKit.git", :tag => s.version } @@ -22,12 +22,6 @@ Pod::Spec.new do |s| subspec.pod_target_xcconfig = { "SWIFT_ACTIVE_COMPILATION_CONDITIONS" => "PERMISSIONSKIT_COCOAPODS" } - subspec.resource_bundles = { - "PermissionsKit" => [ - "Sources/PermissionsKit/Resources/Localization/*.lproj/*.strings", - "Sources/PermissionsKit/Resources/Assets.xcassets", - ] - } end s.subspec 'CameraPermission' do |subspec| diff --git a/README.md b/README.md index fdf4c3f..7f9a1fe 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # PermissionsKit -Universal API for querying the rarefaction and getting the current status `.authorized`, `.denied` & `.notDetermined`. Availalbe three ready-use interface - list, dialog & native. Supports iPad, dark mode and has ready localizations. +Universal API for querying the rarefaction and getting the current status `.authorized`, `.denied` & `.notDetermined`.

@@ -41,7 +41,8 @@ Universal API for querying the rarefaction and getting the current status `.auth - [Installation](#installation) - [Swift Package Manager](#swift-package-manager) - [CocoaPods](#cocoapods) -- [Request & Status](#request--status) +- [Request Permission](#request-permission) +- [Status Permission](#status-permission) - [Keys in Info.plist](#keys-in-infoplist) - [Apple Review](#apple-review) - [Apps Using](#apps-using) @@ -121,20 +122,26 @@ pod 'PermissionsKit/HealthPermission', :git => 'https://github.com/sparrowcode/P ``` -## Request & Status +## Request Permission ```swift import PermissionsKit import NotificationPermission -// Request permission. Permission.notification.request { - // Get status - let authorized = Permission.notification.authorized } ``` +## Status Permission + +```swift +import PermissionsKit +import NotificationPermission + +let authorized = Permission.notification.authorized +``` + ## Keys in Info.plist You need to add some keys to the `Info.plist` file with descriptions, per Apple's requirement(s). You can get a plist of keys for permissions as follows: @@ -169,10 +176,13 @@ Also changed title for button. Instead of `allow` now using `continue`. The App

- + - + +

+ +If you use a `PermissionsKit`, add your application via Pull Request. diff --git a/Sources/BluetoothPermission/BluetoothHandler.swift b/Sources/BluetoothPermission/BluetoothHandler.swift index 0d7ebad..20c8d89 100644 --- a/Sources/BluetoothPermission/BluetoothHandler.swift +++ b/Sources/BluetoothPermission/BluetoothHandler.swift @@ -1,5 +1,5 @@ // The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) +// Copyright © 2022 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Sources/BluetoothPermission/BluetoothPermission.swift b/Sources/BluetoothPermission/BluetoothPermission.swift index 916e824..2730a85 100644 --- a/Sources/BluetoothPermission/BluetoothPermission.swift +++ b/Sources/BluetoothPermission/BluetoothPermission.swift @@ -1,5 +1,5 @@ // The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) +// Copyright © 2022 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Sources/CalendarPermission/CalendarPermission.swift b/Sources/CalendarPermission/CalendarPermission.swift index e044086..cf5efc3 100644 --- a/Sources/CalendarPermission/CalendarPermission.swift +++ b/Sources/CalendarPermission/CalendarPermission.swift @@ -1,5 +1,5 @@ // The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) +// Copyright © 2022 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Sources/CameraPermission/CameraPermission.swift b/Sources/CameraPermission/CameraPermission.swift index c322c86..2c85546 100644 --- a/Sources/CameraPermission/CameraPermission.swift +++ b/Sources/CameraPermission/CameraPermission.swift @@ -1,5 +1,5 @@ // The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) +// Copyright © 2022 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Sources/ContactsPermission/ContactsPermission.swift b/Sources/ContactsPermission/ContactsPermission.swift index 6c15935..73597de 100644 --- a/Sources/ContactsPermission/ContactsPermission.swift +++ b/Sources/ContactsPermission/ContactsPermission.swift @@ -1,5 +1,5 @@ // The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) +// Copyright © 2022 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Sources/FaceIDPermission/FaceIDPermission.swift b/Sources/FaceIDPermission/FaceIDPermission.swift index 2a12c32..f2be1eb 100644 --- a/Sources/FaceIDPermission/FaceIDPermission.swift +++ b/Sources/FaceIDPermission/FaceIDPermission.swift @@ -1,5 +1,5 @@ // The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) +// Copyright © 2022 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Sources/HealthPermission/HealthPermission.swift b/Sources/HealthPermission/HealthPermission.swift index a845f16..deed07b 100644 --- a/Sources/HealthPermission/HealthPermission.swift +++ b/Sources/HealthPermission/HealthPermission.swift @@ -1,5 +1,5 @@ // The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) +// Copyright © 2022 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Sources/LocationAlwaysPermission/LocationAlwaysHandler.swift b/Sources/LocationAlwaysPermission/LocationAlwaysHandler.swift index e922a20..89740b2 100644 --- a/Sources/LocationAlwaysPermission/LocationAlwaysHandler.swift +++ b/Sources/LocationAlwaysPermission/LocationAlwaysHandler.swift @@ -1,5 +1,5 @@ // The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) +// Copyright © 2022 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Sources/LocationAlwaysPermission/LocationAlwaysPermission.swift b/Sources/LocationAlwaysPermission/LocationAlwaysPermission.swift index 22e969f..7c244a2 100644 --- a/Sources/LocationAlwaysPermission/LocationAlwaysPermission.swift +++ b/Sources/LocationAlwaysPermission/LocationAlwaysPermission.swift @@ -1,5 +1,5 @@ // The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) +// Copyright © 2022 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Sources/LocationExtension/LocationAccuracy.swift b/Sources/LocationExtension/LocationAccuracy.swift index 4dc88d7..db765f9 100644 --- a/Sources/LocationExtension/LocationAccuracy.swift +++ b/Sources/LocationExtension/LocationAccuracy.swift @@ -1,5 +1,5 @@ // The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) +// Copyright © 2022 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Sources/LocationWhenInUsePermission/LocationWhenInUseHandler.swift b/Sources/LocationWhenInUsePermission/LocationWhenInUseHandler.swift index 5008d5c..6a0a652 100644 --- a/Sources/LocationWhenInUsePermission/LocationWhenInUseHandler.swift +++ b/Sources/LocationWhenInUsePermission/LocationWhenInUseHandler.swift @@ -1,5 +1,5 @@ // The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) +// Copyright © 2022 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Sources/LocationWhenInUsePermission/LocationWhenInUsePermission.swift b/Sources/LocationWhenInUsePermission/LocationWhenInUsePermission.swift index e7ef4c7..effc7d5 100644 --- a/Sources/LocationWhenInUsePermission/LocationWhenInUsePermission.swift +++ b/Sources/LocationWhenInUsePermission/LocationWhenInUsePermission.swift @@ -1,5 +1,5 @@ // The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) +// Copyright © 2022 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Sources/MediaLibraryPermission/MediaLibraryPermission.swift b/Sources/MediaLibraryPermission/MediaLibraryPermission.swift index a1b1320..4e51159 100644 --- a/Sources/MediaLibraryPermission/MediaLibraryPermission.swift +++ b/Sources/MediaLibraryPermission/MediaLibraryPermission.swift @@ -1,5 +1,5 @@ // The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) +// Copyright © 2022 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Sources/MicrophonePermission/MicrophonePermission.swift b/Sources/MicrophonePermission/MicrophonePermission.swift index 907f352..50a02a9 100644 --- a/Sources/MicrophonePermission/MicrophonePermission.swift +++ b/Sources/MicrophonePermission/MicrophonePermission.swift @@ -1,5 +1,5 @@ // The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) +// Copyright © 2022 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Sources/MotionPermission/MotionPermission.swift b/Sources/MotionPermission/MotionPermission.swift index c473906..3d47a94 100644 --- a/Sources/MotionPermission/MotionPermission.swift +++ b/Sources/MotionPermission/MotionPermission.swift @@ -1,5 +1,5 @@ // The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) +// Copyright © 2022 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Sources/NotificationPermission/NotificationPermission.swift b/Sources/NotificationPermission/NotificationPermission.swift index 360944c..d2cb67a 100644 --- a/Sources/NotificationPermission/NotificationPermission.swift +++ b/Sources/NotificationPermission/NotificationPermission.swift @@ -1,5 +1,5 @@ // The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) +// Copyright © 2022 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Sources/PermissionsKit/Data/Images.swift b/Sources/PermissionsKit/Data/Images.swift deleted file mode 100644 index 5b1dac7..0000000 --- a/Sources/PermissionsKit/Data/Images.swift +++ /dev/null @@ -1,86 +0,0 @@ -// The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import UIKit - -enum Images { - - static func permission_icon(for kind: Permission.Kind) -> UIImage { - switch kind { - case .camera: - return UIImage.init(named: "Camera", in: bundle, compatibleWith: nil) ?? UIImage() - case .photoLibrary: - return UIImage.init(named: "Photos", in: bundle, compatibleWith: nil) ?? UIImage() - case .microphone: - return UIImage.init(named: "Microphone", in: bundle, compatibleWith: nil) ?? UIImage() - case .calendar: - return UIImage.init(named: "Calendar", in: bundle, compatibleWith: nil) ?? UIImage() - case .contacts: - return UIImage.init(named: "Contacts", in: bundle, compatibleWith: nil) ?? UIImage() - case .reminders: - return UIImage.init(named: "Reminders", in: bundle, compatibleWith: nil) ?? UIImage() - case .speech: - return UIImage.init(named: "Speech Recognition", in: bundle, compatibleWith: nil) ?? UIImage() - case .motion: - return UIImage.init(named: "Motion", in: bundle, compatibleWith: nil) ?? UIImage() - case .mediaLibrary: - return UIImage.init(named: "Media Library", in: bundle, compatibleWith: nil) ?? UIImage() - case .bluetooth: - return UIImage.init(named: "Bluetooth", in: bundle, compatibleWith: nil) ?? UIImage() - case .notification: - return UIImage.init(named: "Notifications", in: bundle, compatibleWith: nil) ?? UIImage() - case .locationWhenInUse: - return UIImage.init(named: "Location", in: bundle, compatibleWith: nil) ?? UIImage() - case .locationAlways: - return UIImage.init(named: "Location", in: bundle, compatibleWith: nil) ?? UIImage() - case .tracking: - return UIImage.init(named: "Tracking", in: bundle, compatibleWith: nil) ?? UIImage() - case .faceID: - return UIImage.init(named: "FaceID", in: bundle, compatibleWith: nil) ?? UIImage() - case .siri: - return UIImage.init(named: "Siri", in: bundle, compatibleWith: nil) ?? UIImage() - case .health: - return UIImage.init(named: "Health", in: bundle, compatibleWith: nil) ?? UIImage() - } - } - - static var app_icon_mask: UIImage { - return UIImage.init(named: "App Icon Mask", in: bundle, compatibleWith: nil) ?? UIImage() - } - - // MARK: - Internal - - static var bundle: Bundle { - - // If installed via SPM, will be available bundle .module. - - #if PERMISSIONSKIT_SPM - return .module - #else - - // If installed via Cocoapods, should use bundle from podspec. - - let path = Bundle(for: Permission.self).path(forResource: "PermissionsKit", ofType: "bundle") ?? "" - let bundle = Bundle(path: path) ?? Bundle.main - return bundle - #endif - } -} diff --git a/Sources/PermissionsKit/Data/Text.swift b/Sources/PermissionsKit/Data/Text.swift deleted file mode 100644 index 73f9d07..0000000 --- a/Sources/PermissionsKit/Data/Text.swift +++ /dev/null @@ -1,141 +0,0 @@ -// The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import UIKit - -enum Texts { - - static func permission_name(for kind: Permission.Kind) -> String { - switch kind { - case .camera: - return NSLocalizedString("permission camera name", bundle: bundle, comment: "") - case .photoLibrary: - return NSLocalizedString("permission photoLibrary name", bundle: bundle, comment: "") - case .microphone: - return NSLocalizedString("permission microphone name", bundle: bundle, comment: "") - case .calendar: - return NSLocalizedString("permission calendar name", bundle: bundle, comment: "") - case .contacts: - return NSLocalizedString("permission contacts name", bundle: bundle, comment: "") - case .reminders: - return NSLocalizedString("permission reminders name", bundle: bundle, comment: "") - case .speech: - return NSLocalizedString("permission speech name", bundle: bundle, comment: "") - case .motion: - return NSLocalizedString("permission motion name", bundle: bundle, comment: "") - case .mediaLibrary: - return NSLocalizedString("permission media library name", bundle: bundle, comment: "") - case .bluetooth: - return NSLocalizedString("permission bluetooth name", bundle: bundle, comment: "") - case .notification: - return NSLocalizedString("permission notification name", bundle: bundle, comment: "") - case .locationWhenInUse: - return NSLocalizedString("permission location when in use name", bundle: bundle, comment: "") - case .locationAlways: - return NSLocalizedString("permission location always name", bundle: bundle, comment: "") - case .tracking: - return NSLocalizedString("permission tracking name", bundle: bundle, comment: "") - case .faceID: - return NSLocalizedString("permission faceid name", bundle: bundle, comment: "") - case .siri: - return NSLocalizedString("permission siri name", bundle: bundle, comment: "") - case .health: - return NSLocalizedString("permission health name", bundle: bundle, comment: "") - } - } - - static func permission_description(for kind: Permission.Kind) -> String { - switch kind { - case .camera: - return NSLocalizedString("permission camera description", bundle: bundle, comment: "") - case .photoLibrary: - return NSLocalizedString("permission photoLibrary description", bundle: bundle, comment: "") - case .microphone: - return NSLocalizedString("permission microphone description", bundle: bundle, comment: "") - case .calendar: - return NSLocalizedString("permission calendar description", bundle: bundle, comment: "") - case .contacts: - return NSLocalizedString("permission contacts description", bundle: bundle, comment: "") - case .reminders: - return NSLocalizedString("permission reminders description", bundle: bundle, comment: "") - case .speech: - return NSLocalizedString("permission speech description", bundle: bundle, comment: "") - case .motion: - return NSLocalizedString("permission motion description", bundle: bundle, comment: "") - case .mediaLibrary: - return NSLocalizedString("permission media library description", bundle: bundle, comment: "") - case .bluetooth: - return NSLocalizedString("permission bluetooth description", bundle: bundle, comment: "") - case .notification: - return NSLocalizedString("permission notification description", bundle: bundle, comment: "") - case .locationWhenInUse: - return NSLocalizedString("permission location when in use description", bundle: bundle, comment: "") - case .locationAlways: - return NSLocalizedString("permission location always description", bundle: bundle, comment: "") - case .tracking: - return NSLocalizedString("permission tracking description", bundle: bundle, comment: "") - case .faceID: - return NSLocalizedString("permission faceid description", bundle: bundle, comment: "") - case .siri: - return NSLocalizedString("permission siri description", bundle: bundle, comment: "") - case .health: - return NSLocalizedString("permission health description", bundle: bundle, comment: "") - } - } - - // MARK: - Action Button - - static var allow_permission_action: String { NSLocalizedString("action allow", bundle: bundle, comment: "") } - static var allowed_permission_action: String { NSLocalizedString("action allowed", bundle: bundle, comment: "") } - static var denied_permission_action: String { NSLocalizedString("action denied", bundle: bundle, comment: "") } - - // MARK: - Titles & Comments - - static var header: String { NSLocalizedString("titles header", bundle: bundle, comment: "") } - static var sub_header: String { NSLocalizedString("titles sub header", bundle: bundle, comment: "") } - static var description: String { NSLocalizedString("titles description", bundle: bundle, comment: "") } - static var comment: String { NSLocalizedString("titles comment", bundle: bundle, comment: "") } - - // MARK: - Denied Alert - - static var denied_alert_title: String { NSLocalizedString("denied alert title", bundle: bundle, comment: "") } - static var denied_alert_description: String { NSLocalizedString("denied alert description", bundle: bundle, comment: "") } - static var denied_alert_action: String { NSLocalizedString("denied alert action", bundle: bundle, comment: "") } - static var denied_alert_cancel: String { NSLocalizedString("denied alert cancel", bundle: bundle, comment: "") } - - // MARK: - Internal - - static var bundle: Bundle { - - // If installed via SPM, will be available bundle .module. - - #if PERMISSIONSKIT_SPM - return .module - #else - - // If installed via Cocoapods, should use bundle from podspec. - - let path = Bundle(for: Permission.self).path(forResource: "PermissionsKit", ofType: "bundle") ?? "" - let bundle = Bundle(path: path) ?? Bundle.main - return bundle - #endif - } -} diff --git a/Sources/PermissionsKit/Extensions/ArrayExtension.swift b/Sources/PermissionsKit/Extensions/ArrayExtension.swift deleted file mode 100644 index c7155d1..0000000 --- a/Sources/PermissionsKit/Extensions/ArrayExtension.swift +++ /dev/null @@ -1,45 +0,0 @@ -// The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import Foundation - -extension Array where Element: Equatable { - - var duplicates: [Element] { - var result = [Element]() - for value in self { - if result.contains(value) == true { - result.append(value) - } - } - return result - } - - func removedDuplicates() -> [Element] { - var result = [Element]() - for value in self { - if result.contains(value) == false { - result.append(value) - } - } - return result - } -} diff --git a/Sources/PermissionsKit/Extensions/UIColorExtension.swift b/Sources/PermissionsKit/Extensions/UIColorExtension.swift deleted file mode 100644 index 5b12d7c..0000000 --- a/Sources/PermissionsKit/Extensions/UIColorExtension.swift +++ /dev/null @@ -1,93 +0,0 @@ -// The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import UIKit - -extension UIColor { - - enum Compability { - - static var systemBackground: UIColor { - #if os(iOS) - if #available(iOS 13.0, *) { - return UIColor.systemBackground - } - #endif - return UIColor.white - } - - static var secondarySystemBackground: UIColor { - #if os(iOS) - if #available(iOS 13.0, *) { - return UIColor.secondarySystemBackground - } - #endif - return UIColor(red: 242/255, green: 242/255, blue: 247/255, alpha: 1) - } - - static var separator: UIColor { - if #available(iOS 13.0, tvOS 13.0, *) { - return UIColor.separator - } else { - return UIColor(red: 60/255, green: 60/255, blue: 67/255, alpha: 1) - } - } - - static var label: UIColor { - if #available(iOS 13.0, tvOS 13.0, *) { - return UIColor.label - } else { - return UIColor.black - } - } - - static var secondaryLabel: UIColor { - if #available(iOS 13.0, tvOS 13.0, *) { - return UIColor.secondaryLabel - } else { - return UIColor(red: 138/255, green: 138/255, blue: 142/255, alpha: 1) - } - } - } - - static var buttonArea: UIColor { - if #available(iOS 13.0, tvOS 13.0, *) { - return UIColor { (traits) -> UIColor in - return traits.userInterfaceStyle == .dark ? UIColor(red: 61/255, green: 62/255, blue: 66/255, alpha: 1) : - UIColor(red: 238/255, green: 238/255, blue: 240/255, alpha: 1) - } - } else { - return UIColor(red: 238/255, green: 238/255, blue: 240/255, alpha: 1) - } - } - - @available(iOSApplicationExtension, unavailable) - static var tint: UIColor { - get { - let value = UIApplication.shared.windows.first?.tintColor - guard let tint = value else { return .systemBlue } - return tint - } - set { - UIApplication.shared.windows.forEach({ $0.tintColor = newValue }) - } - } -} diff --git a/Sources/PermissionsKit/Extensions/UIFontExtension.swift b/Sources/PermissionsKit/Extensions/UIFontExtension.swift deleted file mode 100644 index 590a9c2..0000000 --- a/Sources/PermissionsKit/Extensions/UIFontExtension.swift +++ /dev/null @@ -1,32 +0,0 @@ -// The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import UIKit - -extension UIFont { - - static func preferredFont(forTextStyle style: TextStyle, weight: Weight, addPoints: CGFloat = .zero) -> UIFont { - let descriptor = UIFontDescriptor.preferredFontDescriptor(withTextStyle: style) - let font = UIFont.systemFont(ofSize: descriptor.pointSize + addPoints, weight: weight) - let metrics = UIFontMetrics(forTextStyle: style) - return metrics.scaledFont(for: font) - } -} diff --git a/Sources/PermissionsKit/Extensions/UILabelExtension.swift b/Sources/PermissionsKit/Extensions/UILabelExtension.swift deleted file mode 100644 index ef69ca0..0000000 --- a/Sources/PermissionsKit/Extensions/UILabelExtension.swift +++ /dev/null @@ -1,33 +0,0 @@ -// The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import UIKit - -extension UILabel { - - func layoutDynamicHeight(x: CGFloat, y: CGFloat, width: CGFloat) { - frame = CGRect.init(x: x, y: y, width: width, height: frame.height) - sizeToFit() - if frame.width != width { - frame = .init(x: x, y: y, width: width, height: frame.height) - } - } -} diff --git a/Sources/PermissionsKit/Interface/Dialog/DialogCloseButton.swift b/Sources/PermissionsKit/Interface/Dialog/DialogCloseButton.swift deleted file mode 100644 index 2cc9d21..0000000 --- a/Sources/PermissionsKit/Interface/Dialog/DialogCloseButton.swift +++ /dev/null @@ -1,63 +0,0 @@ -// The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import UIKit - -#if os(iOS) - -class DialogCloseButton: UIButton { - - let iconView = CloseIconView() - - // MARK: - Init - - init() { - super.init(frame: .zero) - backgroundColor = .clear - iconView.backgroundColor = .clear - iconView.isUserInteractionEnabled = false - addSubview(iconView) - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - // MARK: - Layout - - override func layoutSubviews() { - super.layoutSubviews() - iconView.frame = bounds - } - - // MARK: - CloseIconView - - class CloseIconView: UIView { - - var elementColor: UIColor = UIColor.Compability.secondaryLabel - var areaColor: UIColor = UIColor.Compability.secondarySystemBackground - - override func draw(_ rect: CGRect) { - DrawService.drawClose(frame: rect, resizing: .aspectFit, background: areaColor, element: elementColor) - } - } -} -#endif diff --git a/Sources/PermissionsKit/Interface/Dialog/DialogGradeBlurView.swift b/Sources/PermissionsKit/Interface/Dialog/DialogGradeBlurView.swift deleted file mode 100644 index 59f7dd5..0000000 --- a/Sources/PermissionsKit/Interface/Dialog/DialogGradeBlurView.swift +++ /dev/null @@ -1,118 +0,0 @@ -// The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#if os(iOS) -import UIKit - -class DialogGradeBlurView: UIView { - - private var gradeView: UIView = UIView() - private var blurView: UIView = UIView() - - // MARK: - Init - - init() { - super.init(frame: CGRect.zero) - backgroundColor = .clear - setGradeColor(UIColor.black) - setGradeAlpha(0) - setBlurRadius(0) - commonInit() - } - - required init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - private func commonInit() { - blurView = PermissionsBlurView() - layer.masksToBounds = true - addSubview(gradeView) - addSubview(blurView) - } - - // MARK: - Helpers - - func setGradeColor(_ color: UIColor) { - gradeView.backgroundColor = UIColor.black - } - - func setGradeAlpha(_ alpha: CGFloat) { - gradeView.alpha = alpha - } - - func setBlurRadius(_ radius: CGFloat) { - if let blurView = self.blurView as? PermissionsBlurView { - blurView.setBlurRadius(radius) - } - } - - // MARK: - Layout - - override func layoutSubviews() { - super.layoutSubviews() - gradeView.frame = bounds - blurView.frame = bounds - } -} - -public class PermissionsBlurView: UIVisualEffectView { - - private let blurEffect: UIBlurEffect - - open var blurRadius: CGFloat { - return blurEffect.value(forKeyPath: "blurRadius") as! CGFloat - } - - public convenience init() { - self.init(withRadius: 0) - } - - public init(withRadius radius: CGFloat) { - if #available(iOS 14, *) { - self.blurEffect = UIBlurEffect(style: .prominent) - super.init(effect: blurEffect) - alpha = 0 - } else { - let customBlurClass: AnyObject.Type = NSClassFromString("_UICustomBlurEffect")! - let customBlurObject: NSObject.Type = customBlurClass as! NSObject.Type - blurEffect = customBlurObject.init() as! UIBlurEffect - blurEffect.setValue(1.0, forKeyPath: "scale") - blurEffect.setValue(radius, forKeyPath: "blurRadius") - super.init(effect: radius == 0 ? nil : self.blurEffect) - } - } - - required public init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - open func setBlurRadius(_ radius: CGFloat) { - if #available(iOS 14, *) { - alpha = (radius == 0) ? 0 : 1 - } else { - guard radius != blurRadius else { return } - blurEffect.setValue(radius, forKeyPath: "blurRadius") - self.effect = blurEffect - } - } -} -#endif diff --git a/Sources/PermissionsKit/Interface/Dialog/DialogTableFooterView.swift b/Sources/PermissionsKit/Interface/Dialog/DialogTableFooterView.swift deleted file mode 100644 index ee975e4..0000000 --- a/Sources/PermissionsKit/Interface/Dialog/DialogTableFooterView.swift +++ /dev/null @@ -1,51 +0,0 @@ -// The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import UIKit - -#if os(iOS) -class DialogTableFooterView: UITableViewHeaderFooterView { - - let titleLabel = UILabel() - - static var id = "DialogTableFooterView" - - override init(reuseIdentifier: String?) { - super.init(reuseIdentifier: reuseIdentifier) - titleLabel.numberOfLines = 0 - titleLabel.font = UIFont.systemFont(ofSize: 12, weight: .regular) - titleLabel.textColor = UIColor.Compability.secondaryLabel.withAlphaComponent(0.5) - titleLabel.translatesAutoresizingMaskIntoConstraints = false - contentView.addSubview(titleLabel) - titleLabel.leadingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.leadingAnchor).isActive = true - titleLabel.trailingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.trailingAnchor).isActive = true - titleLabel.topAnchor.constraint(equalTo: contentView.layoutMarginsGuide.topAnchor, constant: 2).isActive = true - titleLabel.bottomAnchor.constraint(equalTo: contentView.layoutMarginsGuide.bottomAnchor).isActive = true - - insetsLayoutMarginsFromSafeArea = false - contentView.insetsLayoutMarginsFromSafeArea = false - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } -} -#endif diff --git a/Sources/PermissionsKit/Interface/Dialog/PermissionsDialogController.swift b/Sources/PermissionsKit/Interface/Dialog/PermissionsDialogController.swift deleted file mode 100644 index 732c3c1..0000000 --- a/Sources/PermissionsKit/Interface/Dialog/PermissionsDialogController.swift +++ /dev/null @@ -1,331 +0,0 @@ -// The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#if os(iOS) -import UIKit - -@available(iOSApplicationExtension, unavailable) -public class PermissionsDialogController: UIViewController, PermissionsControllerInterface { - - public var showCloseButton: Bool = false - public var allowSwipeDismiss: Bool = true - public var dismissCondition: PermissionsDismissCondition = .default - public var bounceAnimationEnabled = true - - public weak var dataSource: PermissionsDataSource? - public weak var delegate: PermissionsDelegate? - - public var titleText = Texts.header - public var headerText = Texts.sub_header - public var footerText = Texts.comment - - private let dialogView = PermissionsDialogView() - private let backgroundView = DialogGradeBlurView() - - private var permissions: [Permission] - - // MARK: - Init - - init(_ permissions: [Permission]) { - self.permissions = permissions - super.init(nibName: nil, bundle: nil) - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - deinit { - NotificationCenter.default.removeObserver(self, name: UIApplication.didBecomeActiveNotification, object: nil) - } - - // MARK: - Lifecycle - - public override func viewDidLoad() { - super.viewDidLoad() - - view.addSubview(backgroundView) - - // Dialog View - - dialogView.titleLabel.text = titleText - dialogView.subtitleLabel.text = headerText.uppercased() - dialogView.alpha = 0 - dialogView.tableView.dataSource = self - dialogView.tableView.delegate = self - dialogView.tableView.register(DialogTableFooterView.self, forHeaderFooterViewReuseIdentifier: DialogTableFooterView.id) - dialogView.tableView.register(PermissionTableViewCell.self, forCellReuseIdentifier: PermissionTableViewCell.id) - dialogView.closeButton.addTarget(self, action: #selector(self.dimissWithDialog), for: .touchUpInside) - view.addSubview(dialogView) - - dialogView.closeButton.isHidden = !showCloseButton - - // Animator - - animator = UIDynamicAnimator(referenceView: view) - snapBehavior = UISnapBehavior(item: dialogView, snapTo: dialogCenter) - let panGesture = UIPanGestureRecognizer.init(target: self, action: #selector(self.handleGesture(sender:))) - panGesture.maximumNumberOfTouches = 1 - dialogView.addGestureRecognizer(panGesture) - - // Observer - - NotificationCenter.default.addObserver(self, selector: #selector(self.applicationDidBecomeActive), name: UIApplication.didBecomeActiveNotification, object: nil) - } - - public override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - - /** - Special layout call becouse table hasn't valid content size before appear for early ios 12 and lower. - Happen only if `bounceAnimationEnabled` set to false. - Related issue on github: https://github.com/sparrowcode/PermissionsKit/issues/262 - */ - if !bounceAnimationEnabled { - if #available(iOS 13, *) { - // All good for iOS 13+ - } else { - DelayService.wait(0.2, closure: { - self.dialogView.layout(in: self.view) - }) - } - } - } - - @objc func applicationDidBecomeActive() { - dialogView.tableView.reloadData() - } - - // MARK: - Layout - - public override func viewDidLayoutSubviews() { - super.viewDidLayoutSubviews() - backgroundView.frame = view.bounds - dialogView.layout(in: view) - - if bounceAnimationEnabled { - snapBehavior.snapPoint = dialogCenter - } else { - dialogView.center = dialogCenter - } - } - - private var dialogCenter: CGPoint { - let width = view.frame.width - view.layoutMargins.left - view.layoutMargins.right - let height = view.frame.height - view.layoutMargins.top - view.layoutMargins.bottom - return CGPoint(x: view.layoutMargins.left + width / 2, y: view.layoutMargins.top + height / 2) - } - - // MARK: - Helpers - - public func present(on controller: UIViewController) { - animator.removeAllBehaviors() - dialogView.transform = .identity - dialogView.center = CGPoint.init(x: dialogCenter.x, y: dialogCenter.y * 1.2) - modalPresentationStyle = .overCurrentContext - controller.present(self, animated: false, completion: { - UIView.animate(withDuration: 0.3, animations: { - self.backgroundView.setGradeAlpha(0.07) - self.backgroundView.setBlurRadius(4) - }, completion: nil) - UIView.animate(withDuration: 0.3, delay: 0.21, animations: { - self.dialogView.alpha = 1 - }, completion: nil) - DelayService.wait(0.21, closure: { [weak self] in - guard let self = self else { return } - if self.bounceAnimationEnabled { - self.animator.addBehavior(self.snapBehavior) - } - }) - }) - } - - @objc func process(button: PermissionActionButton) { - guard let permission = button.permission else { return } - let firstRequest = permission.status == .notDetermined - permission.request { [weak self] in - - guard let self = self else { return } - if let cell = button.superview as? PermissionTableViewCell { - cell.updateInterface(animated: true) - } - - let authorized = permission.authorized - if authorized { HapticService.impact(.light) } - - // Update `.locationWhenInUse` if allowed `.locationAlwaysAndWhenInUse` - - if permission.kind == .locationAlways { - if self.permissions.contains(where: { $0.kind == .locationWhenInUse }) { - if let index = self.permissions.firstIndex(where: { $0.kind == .locationWhenInUse }) { - if let cell = self.dialogView.tableView.cellForRow(at: IndexPath(row: index, section: 0)) as? PermissionTableViewCell { - cell.updateInterface(animated: true) - } - } - } - } - - let dismissByCondition: () -> Bool = { - switch self.dismissCondition { - case .allPermissionsAuthorized: - let allowedPermissions = self.permissions.filter { $0.authorized } - if allowedPermissions.count == self.permissions.count { - DelayService.wait(0.2, closure: { - self.dismiss(withDialog: true) - }) - return true - } - case .allPermissionsDeterminated: - let determiatedPermissions = self.permissions.filter { !$0.notDetermined } - if determiatedPermissions.count == self.permissions.count { - DelayService.wait(0.2, closure: { - self.dismiss(withDialog: true) - }) - return true - } - } - - return false - } - - - if permission.authorized { - self.delegate?.didAllowPermission(permission) - let _ = dismissByCondition() - } else { - self.delegate?.didDeniedPermission(permission) - if firstRequest { - let _ = dismissByCondition() - } else { - // Delay using for fix animation freeze. - DelayService.wait(0.3, closure: { [weak self] in - guard let self = self else { return } - PresenterService.presentAlertAboutDeniedPermission(permission, dataSource: self.dataSource, on: self) - }) - } - } - } - } - - @objc func dimissWithDialog() { - dismiss(withDialog: true) - } - - public func dismiss(withDialog: Bool) { - if withDialog { - UIView.animate(withDuration: 0.3, delay: 0, usingSpringWithDamping: 1, initialSpringVelocity: 1, options: .beginFromCurrentState, animations: { - self.animator.removeAllBehaviors() - self.dialogView.transform = CGAffineTransform.init(scaleX: 0.9, y: 0.9) - self.dialogView.alpha = 0 - }, completion: nil) - } - UIView.animate(withDuration: 0.3, animations: { - self.backgroundView.setGradeAlpha(0) - self.backgroundView.setBlurRadius(0) - }, completion: { finished in - self.dismiss(animated: false, completion: nil) - }) - } - - public override func dismiss(animated flag: Bool, completion: (() -> Void)? = nil) { - let shoudCallDelegate: Bool = { - if presentedViewController == nil { return true } - if presentedViewController is UIAlertController { return false } - return true - }() - super.dismiss(animated: flag, completion: { - completion?() - if shoudCallDelegate { - self.delegate?.didHidePermissions(self.permissions) - } - }) - } - - // MARK: - Animator - - private var animator = UIDynamicAnimator() - private var attachmentBehavior : UIAttachmentBehavior! - private var gravityBehaviour : UIGravityBehavior! - private var snapBehavior : UISnapBehavior! - - @objc func handleGesture(sender: UIPanGestureRecognizer) { - - guard bounceAnimationEnabled, allowSwipeDismiss else { - return - } - - let location = sender.location(in: view) - let boxLocation = sender.location(in: dialogView) - - switch sender.state { - case .began: - animator.removeAllBehaviors() - let centerOffset = UIOffset(horizontal: boxLocation.x - dialogView.bounds.midX, vertical: boxLocation.y - dialogView.bounds.midY); - attachmentBehavior = UIAttachmentBehavior(item: dialogView, offsetFromCenter: centerOffset, attachedToAnchor: location) - attachmentBehavior.frequency = 0 - animator.addBehavior(attachmentBehavior) - case .changed: - attachmentBehavior.anchorPoint = location - case .ended: - animator.removeBehavior(attachmentBehavior) - animator.addBehavior(snapBehavior) - let translation = sender.translation(in: view) - if translation.y > 100 { - animator.removeAllBehaviors() - gravityBehaviour = UIGravityBehavior(items: [dialogView]) - gravityBehaviour.gravityDirection = CGVector.init(dx: 0, dy: 10) - animator.addBehavior(gravityBehaviour) - dismiss(withDialog: false) - } - default: - break - } - } -} - -// MARK: - Table Data Source & Delegate - -@available(iOSApplicationExtension, unavailable) -extension PermissionsDialogController: UITableViewDataSource, UITableViewDelegate { - - public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return permissions.count - } - - public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let cell = tableView.dequeueReusableCell(withIdentifier: PermissionTableViewCell.id, for: indexPath) as! PermissionTableViewCell - let permission = permissions[indexPath.row] - cell.defaultConfigure(for: permission) - cell.permissionDescriptionLabel.font = UIFont.systemFont(ofSize: 16, weight: .regular) - dataSource?.configure(cell, for: permission) - cell.permissionButton.addTarget(self, action: #selector(self.process(button:)), for: .touchUpInside) - cell.updateInterface(animated: false) - return cell - } - - public func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { - let view = tableView.dequeueReusableHeaderFooterView(withIdentifier: DialogTableFooterView.id) as! DialogTableFooterView - view.titleLabel.text = footerText - view.contentView.backgroundColor = tableView.backgroundColor - return view - } -} -#endif diff --git a/Sources/PermissionsKit/Interface/Dialog/PermissionsDialogView.swift b/Sources/PermissionsKit/Interface/Dialog/PermissionsDialogView.swift deleted file mode 100644 index 5550b63..0000000 --- a/Sources/PermissionsKit/Interface/Dialog/PermissionsDialogView.swift +++ /dev/null @@ -1,116 +0,0 @@ -// The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import UIKit - -#if os(iOS) -class PermissionsDialogView: UIView { - - let closeButton = DialogCloseButton() - let titleLabel = UILabel() - let subtitleLabel = UILabel() - let tableView = UITableView(frame: .zero, style: .plain) - - init() { - super.init(frame: .zero) - - backgroundColor = UIColor.Compability.systemBackground - layer.cornerRadius = 15 - layer.anchorPoint = CGPoint.init(x: 0.5, y: 0.5) - insetsLayoutMarginsFromSafeArea = false - - titleLabel.numberOfLines = 0 - titleLabel.font = UIFont.systemFont(ofSize: 28, weight: .bold) - titleLabel.textColor = UIColor.Compability.label - - addSubview(titleLabel) - - subtitleLabel.numberOfLines = 0 - subtitleLabel.font = UIFont.systemFont(ofSize: 15, weight: .medium) - subtitleLabel.textColor = UIColor.Compability.secondaryLabel - addSubview(subtitleLabel) - - tableView.contentInsetAdjustmentBehavior = .never - tableView.showsVerticalScrollIndicator = false - tableView.showsHorizontalScrollIndicator = false - tableView.delaysContentTouches = false - tableView.insetsContentViewsToSafeArea = false - tableView.preservesSuperviewLayoutMargins = false - tableView.insetsLayoutMarginsFromSafeArea = false - tableView.allowsSelection = false - tableView.separatorInset = UIEdgeInsets(top: 0, left: 45 + 10 - 5, bottom: 0, right: 0) - tableView.alwaysBounceVertical = false - tableView.layer.cornerRadius = layer.cornerRadius - tableView.layer.masksToBounds = true - addSubview(tableView) - - closeButton.iconView.areaColor = .clear - addSubview(closeButton) - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - func layout(in view: UIView) { - var width = view.bounds.width - 20 * 2 - if view.bounds.width > view.bounds.height * 1.35 { - if width > 550 { width = 550 } - } else { - if width > 380 { width = 380 } - } - var height = tableView.frame.origin.y + tableView.contentSize.height + 12 - let maxHeight = (view.bounds.height - view.layoutMargins.top - view.layoutMargins.bottom) * 0.85 - if height > maxHeight { height = maxHeight } - bounds = CGRect.init(x: 0, y: 0, width: width, height: height) - - // Shadow - - let shadowPath = UIBezierPath.init(roundedRect: CGRect.init(x: 0, y: 9, width: bounds.width, height: bounds.height), cornerRadius: layer.cornerRadius) - layer.shadowColor = UIColor.black.cgColor - layer.shadowOffset = CGSize.zero - layer.shadowOpacity = Float(0.07) - layer.shadowRadius = layer.cornerRadius - layer.masksToBounds = false - layer.shadowPath = shadowPath.cgPath - } - - override func layoutSubviews() { - super.layoutSubviews() - let inset: CGFloat = 19 - let contentWidth = bounds.width - inset - inset - let closeSide: CGFloat = 34 - closeButton.frame = CGRect.init(x: bounds.width - inset / 2.5 - closeSide, y: inset / 2.5, width: closeSide, height: closeSide) - subtitleLabel.layoutDynamicHeight(x: inset, y: inset, width: contentWidth) - titleLabel.layoutDynamicHeight(x: inset, y: subtitleLabel.frame.origin.y + subtitleLabel.frame.height + 2, width: contentWidth) - let contentHeight = tableView.contentSize.height - let maxHeight = bounds.height - tableView.frame.origin.y - tableView.frame = CGRect.init(x: 0, y: titleLabel.frame.origin.y + titleLabel.frame.height + 2, width: bounds.width, height: min(contentHeight, maxHeight)) - tableView.layoutMargins = UIEdgeInsets(top: 0, left: inset, bottom: 0, right: inset) - - // RTL - - if effectiveUserInterfaceLayoutDirection == .rightToLeft { - closeButton.frame.origin.x = inset / 2.5 - } - } -} -#endif diff --git a/Sources/PermissionsKit/Interface/List/PermissionsList.swift b/Sources/PermissionsKit/Interface/List/PermissionsList.swift deleted file mode 100644 index 322ff25..0000000 --- a/Sources/PermissionsKit/Interface/List/PermissionsList.swift +++ /dev/null @@ -1,53 +0,0 @@ -// The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#if os(iOS) && canImport(SwiftUI) -import SwiftUI - -@available(iOS 13.0, *) -@available(iOSApplicationExtension, unavailable) -public struct PermissionsList: UIViewControllerRepresentable { - - private weak var dataSource: PermissionsDataSource? - private weak var delegate: PermissionsDelegate? - - private var permissions: [Permission] - - public init(permissions: [Permission], dataSource: PermissionsDataSource? = nil, delegate: PermissionsDelegate? = nil) { - self.permissions = permissions - self.dataSource = dataSource - self.delegate = delegate - } - - // MARK: - UIViewControllerRepresentable - - public typealias UIViewControllerType = UINavigationController - - public func makeUIViewController(context: Context) -> UINavigationController { - let controller = PermissionsListController(permissions) - controller.dataSource = self.dataSource - controller.delegate = self.delegate - return UINavigationController(rootViewController: controller) - } - - public func updateUIViewController(_ uiViewController: UINavigationController, context: Context) {} -} -#endif diff --git a/Sources/PermissionsKit/Interface/List/PermissionsListController.swift b/Sources/PermissionsKit/Interface/List/PermissionsListController.swift deleted file mode 100644 index 1111d3e..0000000 --- a/Sources/PermissionsKit/Interface/List/PermissionsListController.swift +++ /dev/null @@ -1,235 +0,0 @@ -// The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#if os(iOS) -import UIKit - -@available(iOSApplicationExtension, unavailable) -public class PermissionsListController: UITableViewController, PermissionsControllerInterface { - - public var showCloseButton: Bool = false - public var allowSwipeDismiss: Bool = true - public var dismissCondition: PermissionsDismissCondition = .default - - public weak var dataSource: PermissionsDataSource? - public weak var delegate: PermissionsDelegate? - - public var titleText = Texts.header - public var headerText = Texts.description - public var footerText = Texts.comment - public var prefersLargeTitles = true - - private var permissions: [Permission] - - // MARK: - Init - - init(_ permissions: [Permission]) { - self.permissions = permissions - if #available(iOS 13.0, *) { - super.init(style: .insetGrouped) - } else { - super.init(style: .grouped) - } - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - deinit { - NotificationCenter.default.removeObserver(self, name: UIApplication.didBecomeActiveNotification, object: nil) - } - - // MARK: - Lifecycle - - override public func viewDidLoad() { - super.viewDidLoad() - if showCloseButton { - let closeBarButtonItem: UIBarButtonItem = { - if #available(iOS 13.0, *) { - return UIBarButtonItem(barButtonSystemItem: .close, target: self, action: #selector(dismissAnimated)) - } else { - return UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(dismissAnimated)) - } - }() - if view.effectiveUserInterfaceLayoutDirection == .leftToRight { - navigationItem.rightBarButtonItem = closeBarButtonItem - } else { - navigationItem.leftBarButtonItem = closeBarButtonItem - } - } - - navigationItem.title = titleText - navigationItem.largeTitleDisplayMode = .automatic - navigationController?.navigationBar.prefersLargeTitles = prefersLargeTitles - navigationController?.presentationController?.delegate = self - - tableView.delaysContentTouches = false - tableView.allowsSelection = false - tableView.register(PermissionTableViewCell.self, forCellReuseIdentifier: PermissionTableViewCell.id) - tableView.register(PermissionsListHeaderView.self, forHeaderFooterViewReuseIdentifier: PermissionsListHeaderView.id) - tableView.register(PermissionsListFooterCommentView.self, forHeaderFooterViewReuseIdentifier: PermissionsListFooterCommentView.id) - - NotificationCenter.default.addObserver(self, selector: #selector(self.applicationDidBecomeActive), name: UIApplication.didBecomeActiveNotification, object: nil) - } - - @objc func applicationDidBecomeActive() { - tableView.reloadData() - } - - // MARK: - Helpers - - public func present(on controller: UIViewController) { - let navigationController = UINavigationController(rootViewController: self) - navigationController.modalPresentationStyle = .formSheet - navigationController.preferredContentSize = CGSize.init(width: 480, height: 560) - controller.present(navigationController, animated: true, completion: nil) - } - - @objc func process(button: PermissionActionButton) { - guard let permission = button.permission else { return } - let firstRequest = permission.status == .notDetermined - permission.request { [weak self] in - - guard let self = self else { return } - if let cell = button.superview as? PermissionTableViewCell { - cell.updateInterface(animated: true) - } - - let authorized = permission.authorized - if authorized { HapticService.impact(.light) } - - // Update `.locationWhenInUse` if allowed `.locationAlwaysAndWhenInUse` - - if permission.kind == .locationAlways { - if self.permissions.contains(where: { $0.kind == .locationWhenInUse }) { - if let index = self.permissions.firstIndex(where: { $0.kind == .locationWhenInUse }) { - if let cell = self.tableView.cellForRow(at: IndexPath(row: index, section: 0)) as? PermissionTableViewCell { - cell.updateInterface(animated: true) - } - } - } - } - - let dismissByCondition: () -> Bool = { - switch self.dismissCondition { - case .allPermissionsAuthorized: - let allowedPermissions = self.permissions.filter { $0.authorized } - if allowedPermissions.count == self.permissions.count { - DelayService.wait(0.2, closure: { - self.dismiss(animated: true) - }) - return true - } - - case .allPermissionsDeterminated: - let determiatedPermissions = self.permissions.filter { !$0.notDetermined } - if determiatedPermissions.count == self.permissions.count { - DelayService.wait(0.2, closure: { - self.dismiss(animated: true) - }) - return true - } - } - - return false - } - - if permission.authorized { - self.delegate?.didAllowPermission(permission) - let _ = dismissByCondition() - } else { - self.delegate?.didDeniedPermission(permission) - if firstRequest { - let _ = dismissByCondition() - } else { - // Delay using for fix animation freeze. - DelayService.wait(0.3, closure: { [weak self] in - guard let self = self else { return } - PresenterService.presentAlertAboutDeniedPermission(permission, dataSource: self.dataSource, on: self) - }) - } - } - } - } - - @objc func dismissAnimated() { - self.dismiss(animated: true, completion: nil) - } - - public override func dismiss(animated flag: Bool, completion: (() -> Void)? = nil) { - super.dismiss(animated: flag, completion: { [weak self] in - completion?() - self?.processDissmissedEvent() - }) - } - - private func processDissmissedEvent() { - delegate?.didHidePermissions(permissions) - } -} - -// MARK: - Table Data Source & Delegate - -@available(iOSApplicationExtension, unavailable) -extension PermissionsListController { - - public override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return permissions.count - } - - public override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let permission = permissions[indexPath.row] - let cell = tableView.dequeueReusableCell(withIdentifier: PermissionTableViewCell.id, for: indexPath) as! PermissionTableViewCell - cell.defaultConfigure(for: permission) - dataSource?.configure(cell, for: permission) - cell.permissionButton.addTarget(self, action: #selector(self.process(button:)), for: .touchUpInside) - cell.updateInterface(animated: false) - return cell - } - - public override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { - let view = tableView.dequeueReusableHeaderFooterView(withIdentifier: PermissionsListHeaderView.id) as! PermissionsListHeaderView - view.titleLabel.text = headerText - return view - } - - public override func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { - let view = tableView.dequeueReusableHeaderFooterView(withIdentifier: PermissionsListFooterCommentView.id) as! PermissionsListFooterCommentView - view.titleLabel.text = footerText - return view - } -} - -// MARK: - UIAdaptivePresentationControllerDelegate - -@available(iOSApplicationExtension, unavailable) -extension PermissionsListController: UIAdaptivePresentationControllerDelegate { - - public func presentationControllerShouldDismiss(_ presentationController: UIPresentationController) -> Bool { - return allowSwipeDismiss - } - - public func presentationControllerDidDismiss(_ presentationController: UIPresentationController) { - self.processDissmissedEvent() - } -} -#endif diff --git a/Sources/PermissionsKit/Interface/List/PermissionsListFooterCommentView.swift b/Sources/PermissionsKit/Interface/List/PermissionsListFooterCommentView.swift deleted file mode 100644 index 5d60f6a..0000000 --- a/Sources/PermissionsKit/Interface/List/PermissionsListFooterCommentView.swift +++ /dev/null @@ -1,60 +0,0 @@ -// The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import UIKit - -#if os(iOS) -class PermissionsListFooterCommentView: UITableViewHeaderFooterView { - - let titleLabel = UILabel() - - static var id = "PermissionsListFooterCommentView" - - override init(reuseIdentifier: String?) { - super.init(reuseIdentifier: reuseIdentifier) - titleLabel.numberOfLines = 0 - titleLabel.font = UIFont.systemFont(ofSize: 14, weight: .regular) - titleLabel.textColor = UIColor.Compability.secondaryLabel - titleLabel.translatesAutoresizingMaskIntoConstraints = false - contentView.addSubview(titleLabel) - - let leadingAnchorConstraint = titleLabel.leadingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.leadingAnchor) - leadingAnchorConstraint.priority = .init(900) - leadingAnchorConstraint.isActive = true - - let trailingAnchorConstraint = titleLabel.trailingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.trailingAnchor) - trailingAnchorConstraint.priority = .init(900) - trailingAnchorConstraint.isActive = true - - let topAnchorConstraint = titleLabel.topAnchor.constraint(equalTo: contentView.layoutMarginsGuide.topAnchor, constant: 3) - topAnchorConstraint.priority = .init(900) - topAnchorConstraint.isActive = true - - let bottomAnchorConstraint = titleLabel.bottomAnchor.constraint(equalTo: contentView.layoutMarginsGuide.bottomAnchor) - bottomAnchorConstraint.priority = .init(900) - bottomAnchorConstraint.isActive = true - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } -} -#endif diff --git a/Sources/PermissionsKit/Interface/List/PermissionsListHeaderView.swift b/Sources/PermissionsKit/Interface/List/PermissionsListHeaderView.swift deleted file mode 100644 index 9571d7d..0000000 --- a/Sources/PermissionsKit/Interface/List/PermissionsListHeaderView.swift +++ /dev/null @@ -1,60 +0,0 @@ -// The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#if os(iOS) -import UIKit - -class PermissionsListHeaderView: UITableViewHeaderFooterView { - - let titleLabel = UILabel() - - static var id = "PermissionsListHeaderView" - - override init(reuseIdentifier: String?) { - super.init(reuseIdentifier: reuseIdentifier) - titleLabel.numberOfLines = 0 - titleLabel.font = UIFont.systemFont(ofSize: 17, weight: .regular) - titleLabel.textColor = UIColor.Compability.secondaryLabel - titleLabel.translatesAutoresizingMaskIntoConstraints = false - addSubview(titleLabel) - - let leadingAnchorConstraint = titleLabel.leadingAnchor.constraint(equalTo: layoutMarginsGuide.leadingAnchor) - leadingAnchorConstraint.priority = .init(900) - leadingAnchorConstraint.isActive = true - - let trailingAnchorConstraint = titleLabel.trailingAnchor.constraint(equalTo: layoutMarginsGuide.trailingAnchor) - trailingAnchorConstraint.priority = .init(900) - trailingAnchorConstraint.isActive = true - - let topAnchorConstraint = titleLabel.topAnchor.constraint(equalTo: layoutMarginsGuide.topAnchor, constant: -2) - topAnchorConstraint.priority = .init(900) - topAnchorConstraint.isActive = true - - let bottomAnchorConstraint = titleLabel.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -25) - bottomAnchorConstraint.priority = .init(900) - bottomAnchorConstraint.isActive = true - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } -} -#endif diff --git a/Sources/PermissionsKit/Interface/Native/PermissionsNativeController.swift b/Sources/PermissionsKit/Interface/Native/PermissionsNativeController.swift deleted file mode 100644 index 13b7d58..0000000 --- a/Sources/PermissionsKit/Interface/Native/PermissionsNativeController.swift +++ /dev/null @@ -1,66 +0,0 @@ -// The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import UIKit - -@available(iOSApplicationExtension, unavailable) -public class PermissionsNativeController: NSObject, PermissionsControllerInterface { - - public weak var delegate: PermissionsDelegate? - public weak var dataSource: PermissionsDataSource? - - // MARK: - Data - - private var permissions: [Permission] - private var proceseedPermissions: [Permission] = [] - private var memoryLocker: PermissionsNativeController? = nil - - // MARK: - Init - - init(_ permissions: [Permission]) { - self.permissions = permissions - super.init() - } - - // MARK: - Public - - public func present(on controller: UIViewController) { - self.memoryLocker = self - self.proceseedPermissions = permissions - for permission in permissions { - permission.request(completion: { [weak self] in - self?.proceseedPermissions = self?.proceseedPermissions.filter({ $0 != permission }) ?? [] - guard let self = self else { return } - if permission.authorized { - self.delegate?.didAllowPermission(permission) - } else { - self.delegate?.didDeniedPermission(permission) - PresenterService.presentAlertAboutDeniedPermission(permission, dataSource: self.dataSource, on: controller) - } - - if self.proceseedPermissions.isEmpty { - self.memoryLocker = nil - self.delegate?.didHidePermissions(self.permissions) - } - }) - } - } -} diff --git a/Sources/PermissionsKit/Interface/Shared/PermissionActionButton.swift b/Sources/PermissionsKit/Interface/Shared/PermissionActionButton.swift deleted file mode 100644 index f918a8f..0000000 --- a/Sources/PermissionsKit/Interface/Shared/PermissionActionButton.swift +++ /dev/null @@ -1,90 +0,0 @@ -// The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import UIKit - -#if os(iOS) -@available(iOSApplicationExtension, unavailable) -public class PermissionActionButton: UIButton { - - var permission: Permission? - - public var allowTitle: String = Texts.allow_permission_action - public var allowTitleColor: UIColor = UIColor.tint - public var allowBackgroundColor: UIColor = UIColor.buttonArea - - public var allowedTitle: String = Texts.allowed_permission_action - public var allowedTitleColor: UIColor = UIColor.white - public var allowedBackgroundColor: UIColor = UIColor.tint - - public var deniedTitle: String = Texts.denied_permission_action - public var deniedTitleColor: UIColor = UIColor.tint - public var deniedBackgroundColor: UIColor = UIColor.buttonArea - - // MARK: - Init - - init() { - super.init(frame: .zero) - contentEdgeInsets = UIEdgeInsets.init(top: 5, left: 13, bottom: 5, right: 13) - titleLabel?.font = UIFont.systemFont(ofSize: 15, weight: .bold) - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - // MARK: - Helpers - - func updateInterface() { - guard let permission = self.permission else { return } - switch permission.status { - case .notDetermined, .notSupported: - setTitle(allowTitle, for: .normal) - setTitleColor(allowTitleColor, for: .normal) - setTitleColor(allowTitleColor.withAlphaComponent(0.7), for: .highlighted) - backgroundColor = allowBackgroundColor - case .authorized: - setTitle(allowedTitle, for: .normal) - backgroundColor = allowedBackgroundColor - setTitleColor(allowedTitleColor, for: .normal) - setTitleColor(allowedTitleColor.withAlphaComponent(0.7), for: .highlighted) - case .denied: - setTitle(deniedTitle, for: .normal) - backgroundColor = deniedBackgroundColor - setTitleColor(deniedTitleColor, for: .normal) - setTitleColor(deniedTitleColor.withAlphaComponent(0.7), for: .highlighted) - } - } - - // MARK: - Layout - - override public func layoutSubviews() { - super.layoutSubviews() - layer.cornerRadius = self.frame.height / 2 - } - - // MARK: - Ovveride - - override public func setTitle(_ title: String?, for state: UIControl.State) { - super.setTitle(title?.uppercased(), for: state) - } -} -#endif diff --git a/Sources/PermissionsKit/Interface/Shared/PermissionDrawIconView.swift b/Sources/PermissionsKit/Interface/Shared/PermissionDrawIconView.swift deleted file mode 100644 index ce092e1..0000000 --- a/Sources/PermissionsKit/Interface/Shared/PermissionDrawIconView.swift +++ /dev/null @@ -1,90 +0,0 @@ -// The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import UIKit - -#if os(iOS) -@available(iOSApplicationExtension, unavailable) -public class PermissionDrawIconView: UIView { - - var permission: Permission? { - didSet { - setNeedsDisplay() - } - } - - // MARK: - Init - - init() { - super.init(frame: CGRect.zero) - commonInit() - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - private func commonInit() { - self.backgroundColor = UIColor.clear - } - - // MARK: - Draw - - override public func draw(_ rect: CGRect) { - super.draw(rect) - switch permission?.kind { - case .camera: - DrawService.drawCamera(frame: rect, resizing: .aspectFit, color: tintColor) - case .photoLibrary: - DrawService.drawPhotos(frame: rect, resizing: .aspectFit, color: tintColor) - case .notification: - DrawService.drawNotifications(frame: rect, resizing: .aspectFit, color: tintColor) - case .microphone: - DrawService.drawMicrophone(frame: rect, resizing: .aspectFit, color: tintColor) - case .calendar: - DrawService.drawCalendar(frame: rect, resizing: .aspectFit, color: tintColor) - case .contacts: - DrawService.drawContacts(frame: rect, resizing: .aspectFit, color: tintColor) - case .reminders: - DrawService.drawReminders(frame: rect, resizing: .aspectFit, color: tintColor) - case .speech: - DrawService.drawSpeech(frame: rect, resizing: .aspectFit, color: tintColor) - case .locationWhenInUse: - DrawService.drawLocations(frame: rect, resizing: .aspectFit, color: tintColor) - case .locationAlways: - DrawService.drawLocations(frame: rect, resizing: .aspectFit, color: tintColor) - case .motion: - DrawService.drawMotion(frame: rect, resizing: .aspectFit, color: tintColor) - case .mediaLibrary: - DrawService.drawMedia(frame: rect, resizing: .aspectFit, color: tintColor) - case .bluetooth: - DrawService.drawBluetooth(frame: rect, resizing: .aspectFit, color: tintColor) - case .tracking: - DrawService.drawTracking(frame: rect, resizing: .aspectFit, color: tintColor) - case .faceID, .siri, .health: - // Not implemented old style icons. - break - case .none: - break - } - } -} -#endif diff --git a/Sources/PermissionsKit/Interface/Shared/PermissionIconView.swift b/Sources/PermissionsKit/Interface/Shared/PermissionIconView.swift deleted file mode 100644 index 98d1701..0000000 --- a/Sources/PermissionsKit/Interface/Shared/PermissionIconView.swift +++ /dev/null @@ -1,100 +0,0 @@ -// The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import UIKit - -@available(iOSApplicationExtension, unavailable) -public class PermissionIconView: UIView { - - // MARK: - Views - - private var customView: UIView? - private var customImageView = UIImageView() - private let iconMaskView = UIImageView() - private let iconImageView = UIImageView() - - // MARK: - Init - - init() { - super.init(frame: .zero) - commonInit() - } - - required init?(coder: NSCoder) { - super.init(coder: coder) - commonInit() - } - - private func commonInit() { - addSubview(iconImageView) - iconImageView.isHidden = true - - addSubview(customImageView) - customImageView.isHidden = true - } - - // MARK: - Layout - - public override func layoutSubviews() { - super.layoutSubviews() - iconImageView.frame = bounds - iconMaskView.frame = bounds - customImageView.frame = bounds - customView?.frame = bounds - } - - // MARK: - Helpers - - public func setPermission(_ kind: Permission.Kind) { - iconImageView.image = Images.permission_icon(for: kind) - iconImageView.contentMode = .scaleAspectFit - - iconMaskView.image = Images.app_icon_mask - iconMaskView.contentMode = .scaleAspectFit - iconImageView.mask = iconMaskView - - iconImageView.isHidden = false - customImageView.isHidden = true - customView?.isHidden = true - } - - public func setCustomView(_ view: UIView) { - if let customView = self.customView { - customView.removeFromSuperview() - } - - addSubview(view) - self.customView = view - - iconImageView.isHidden = true - customImageView.isHidden = true - customView?.isHidden = false - } - - public func setCustomImage(_ image: UIImage) { - customImageView.contentMode = .scaleAspectFit - customImageView.image = image - - iconImageView.isHidden = true - customImageView.isHidden = false - customView?.isHidden = true - } -} diff --git a/Sources/PermissionsKit/Interface/Shared/PermissionTableViewCell.swift b/Sources/PermissionsKit/Interface/Shared/PermissionTableViewCell.swift deleted file mode 100644 index 5320355..0000000 --- a/Sources/PermissionsKit/Interface/Shared/PermissionTableViewCell.swift +++ /dev/null @@ -1,164 +0,0 @@ -// The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#if os(iOS) -import UIKit - -@available(iOSApplicationExtension, unavailable) -public class PermissionTableViewCell: UITableViewCell { - - public let permissionTitleLabel = UILabel() - public let permissionDescriptionLabel = UILabel() - public let permissionButton = PermissionActionButton() - public let permissionIconView = PermissionIconView() - - static var id = "PermissionTableViewCell" - - // MARK: - Init - - override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { - super.init(style: style, reuseIdentifier: reuseIdentifier) - commonInit() - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - private func commonInit() { - let verticalSpace: CGFloat = 16 - contentView.layoutMargins = .init(top: verticalSpace, left: 0, bottom: verticalSpace, right: 0) - - permissionTitleLabel.numberOfLines = 0 - permissionTitleLabel.textColor = UIColor.Compability.label - permissionTitleLabel.font = UIFont.systemFont(ofSize: 22, weight: .semibold) - addSubview(permissionTitleLabel) - - permissionDescriptionLabel.numberOfLines = 0 - permissionDescriptionLabel.textColor = UIColor.Compability.secondaryLabel - permissionDescriptionLabel.font = UIFont.systemFont(ofSize: 17, weight: .regular) - addSubview(permissionDescriptionLabel) - - addSubview(permissionButton) - addSubview(permissionIconView) - - insetsLayoutMarginsFromSafeArea = false - contentView.insetsLayoutMarginsFromSafeArea = false - } - - // MARK: - Lifecycle - - public override func prepareForReuse() { - super.prepareForReuse() - permissionTitleLabel.text = nil - permissionDescriptionLabel.text = nil - permissionButton.removeTarget(nil, action: nil, for: .allEvents) - } - - // MARK: - Layout - - public override func layoutSubviews() { - super.layoutSubviews() - - // Icons - - permissionIconView.frame = .init(x: contentView.layoutMargins.left - 2, y: contentView.layoutMargins.top, width: 36, height: 36) - - // Button - - permissionButton.sizeToFit() - permissionButton.frame.origin.x = contentView.frame.width - contentView.layoutMargins.right - permissionButton.frame.width - - // Titles - - let leftContentLeadingSpace: CGFloat = 13 - let leftContentTrailingSpace: CGFloat = 13 - let leftContentXPosition = contentView.layoutMargins.left + permissionIconView.frame.width + leftContentLeadingSpace - let leftContentWidth = contentView.frame.width - leftContentXPosition - permissionButton.frame.width - leftContentTrailingSpace - contentView.layoutMargins.right - - permissionTitleLabel.layoutDynamicHeight(x: leftContentXPosition, y: contentView.layoutMargins.top, width: leftContentWidth) - - permissionDescriptionLabel.layoutDynamicHeight(x: leftContentXPosition, y: permissionTitleLabel.frame.origin.y + permissionTitleLabel.frame.height + 4, width: leftContentWidth) - - // Button Vertical Centering - - permissionButton.center.y = calculatedHeight / 2 - - // RTL - - if effectiveUserInterfaceLayoutDirection == .rightToLeft { - permissionIconView.frame.origin.x = contentView.frame.width - contentView.layoutMargins.right - permissionIconView.frame.width - permissionButton.frame.origin.x = contentView.layoutMargins.right - permissionTitleLabel.frame.origin.x = permissionIconView.frame.origin.x - leftContentLeadingSpace - permissionTitleLabel.frame.width - permissionDescriptionLabel.frame.origin.x = permissionTitleLabel.frame.origin.x - separatorInset.left = frame.width - permissionDescriptionLabel.frame.maxX - } else { - separatorInset.left = permissionIconView.frame.maxX + leftContentLeadingSpace - } - } - - private var calculatedHeight: CGFloat { - return permissionDescriptionLabel.frame.origin.y + permissionDescriptionLabel.frame.height + contentView.layoutMargins.bottom - } - - public override func sizeThatFits(_ size: CGSize) -> CGSize { - let superSize = super.sizeThatFits(size) - layoutSubviews() - return CGSize.init(width: superSize.width, height: calculatedHeight) - } - - // MARK: - Helpers - - func defaultConfigure(for permission: Permission) { - - permissionTitleLabel.text = Texts.permission_name(for: permission.kind) - permissionDescriptionLabel.text = Texts.permission_description(for: permission.kind) - - permissionButton.permission = permission - permissionButton.allowTitle = Texts.allow_permission_action - permissionButton.allowedTitle = Texts.allowed_permission_action - permissionButton.allowTitleColor = UIColor.tint - permissionButton.allowBackgroundColor = UIColor.buttonArea - permissionButton.allowedTitleColor = UIColor.white - permissionButton.allowedBackgroundColor = UIColor.tint - - permissionIconView.setPermission(permission.kind) - - layoutSubviews() - } - - func updateInterface(animated: Bool) { - let changes = { [weak self] in - guard let self = self else { return } - self.permissionButton.updateInterface() - self.layoutSubviews() - } - - if animated { - UIView.animate(withDuration: 0.3, animations: { - changes() - }) - } else { - changes() - } - } -} -#endif diff --git a/Sources/PermissionsKit/Models/DeniedPermissionAlertTexts.swift b/Sources/PermissionsKit/Models/DeniedPermissionAlertTexts.swift deleted file mode 100644 index 5877a6d..0000000 --- a/Sources/PermissionsKit/Models/DeniedPermissionAlertTexts.swift +++ /dev/null @@ -1,47 +0,0 @@ -// The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import UIKit - -public class DeniedPermissionAlertTexts: NSObject { - - public var titleText = Texts.denied_alert_title - public var descriptionText = Texts.denied_alert_description - public var actionText = Texts.denied_alert_action - public var cancelText = Texts.denied_alert_cancel - - public override init() { - super.init() - } - - public init(title: String, description: String, action: String, cancel: String) { - self.titleText = title - - self.descriptionText = description - self.actionText = action - self.cancelText = cancel - super.init() - } - - public static var `default`: DeniedPermissionAlertTexts { - return DeniedPermissionAlertTexts() - } -} diff --git a/Sources/PermissionsKit/Models/PermissionsDismissCondition.swift b/Sources/PermissionsKit/Models/PermissionsDismissCondition.swift deleted file mode 100644 index 29d8c5e..0000000 --- a/Sources/PermissionsKit/Models/PermissionsDismissCondition.swift +++ /dev/null @@ -1,30 +0,0 @@ -// The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import UIKit - -public enum PermissionsDismissCondition { - - case allPermissionsAuthorized - case allPermissionsDeterminated - - static var `default`: PermissionsDismissCondition { allPermissionsAuthorized } -} diff --git a/Sources/PermissionsKit/Models/Permission.swift b/Sources/PermissionsKit/Permission.swift similarity index 96% rename from Sources/PermissionsKit/Models/Permission.swift rename to Sources/PermissionsKit/Permission.swift index a543fc1..2f5981d 100644 --- a/Sources/PermissionsKit/Models/Permission.swift +++ b/Sources/PermissionsKit/Permission.swift @@ -1,5 +1,5 @@ // The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) +// Copyright © 2022 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -82,10 +82,6 @@ open class Permission: Equatable { return lhs.kind == rhs.kind } - open var canBePresentWithCustomInterface: Bool { - return true - } - public init() {} // MARK: - Models diff --git a/Sources/PermissionsKit/PermissionsKit.swift b/Sources/PermissionsKit/PermissionsKit.swift index 21a9b02..7a97111 100644 --- a/Sources/PermissionsKit/PermissionsKit.swift +++ b/Sources/PermissionsKit/PermissionsKit.swift @@ -1,5 +1,5 @@ // The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) +// Copyright © 2022 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Sources/PermissionsKit/Protocols/PermissionsControllerInterface.swift b/Sources/PermissionsKit/Protocols/PermissionsControllerInterface.swift deleted file mode 100644 index 47405a7..0000000 --- a/Sources/PermissionsKit/Protocols/PermissionsControllerInterface.swift +++ /dev/null @@ -1,46 +0,0 @@ -// The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import UIKit - -/** - PermissionsKit: Protocol using for implement all same properties for each interface style. - */ -@available(iOSApplicationExtension, unavailable) -protocol PermissionsControllerInterface { - - /** - PermissionsKit: Data source object. - */ - var dataSource: PermissionsDataSource? { get set } - - /** - PermissionsKit: Delegate object. - */ - var delegate: PermissionsDelegate? { get set } - - /** - PermissionsKit: Using for process present logic. - - - Note: Better use native logic for custom presenting controller. Now added to next feature. - */ - func present(on controller: UIViewController) -} diff --git a/Sources/PermissionsKit/Protocols/PermissionsDataSource.swift b/Sources/PermissionsKit/Protocols/PermissionsDataSource.swift deleted file mode 100644 index e905a26..0000000 --- a/Sources/PermissionsKit/Protocols/PermissionsDataSource.swift +++ /dev/null @@ -1,58 +0,0 @@ -// The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import UIKit - -/** - PermissionsKit: Protocol using for configure permission cell and alert texts. - */ -@available(iOSApplicationExtension, unavailable) -public protocol PermissionsDataSource: AnyObject { - - #if os(iOS) - /** - PermissionsKit: After default configure you can apply your changes like texts or custom icon. - - - parameter cell: Default cell object of class `PermissionTableViewCell`. - - parameter permission: For which permissions cell configuring. - */ - func configure(_ cell: PermissionTableViewCell, for permission: Permission) - #endif - - /** - PermissionsKit: Provide here alert texts if permission denied. - If you return `nil` for alert texts, alert won't show. - - - parameter permission: Text for this permission. - */ - func deniedPermissionAlertTexts(for permission: Permission) -> DeniedPermissionAlertTexts? -} - -// Using like default for allow it like optional. -@available(iOSApplicationExtension, unavailable) -public extension PermissionsDataSource { - - #if os(iOS) - func configure(_ cell: PermissionTableViewCell, for permission: Permission) -> PermissionTableViewCell { return cell } - #endif -} - - diff --git a/Sources/PermissionsKit/Protocols/PermissionsDelegate.swift b/Sources/PermissionsKit/Protocols/PermissionsDelegate.swift deleted file mode 100644 index 9ab6b30..0000000 --- a/Sources/PermissionsKit/Protocols/PermissionsDelegate.swift +++ /dev/null @@ -1,61 +0,0 @@ -// The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import UIKit - -/** - PermissionsKit: Get notifications about events. - */ -@available(iOSApplicationExtension, unavailable) -public protocol PermissionsDelegate: AnyObject { - - /** - PermissionsKit: Called when permission allowed. - - - parameter permission: For which permission action invocation. - */ - func didAllowPermission(_ permission: Permission) - - /** - PermissionsKit: Called when permission denied. - - - parameter permission: For which permission action invocation. - */ - func didDeniedPermission(_ permission: Permission) - - /** - PermissionsKit: Called when permission hided. - - - parameter permission: For which permission action invocation. - */ - func didHidePermissions(_ permissions: [Permission]) -} - -// Using like default for allow it like optional. -@available(iOSApplicationExtension, unavailable) -public extension PermissionsDelegate { - - func didAllowPermission(_ permission: Permission) {} - - func didDeniedPermission(_ permission: Permission) {} - - func didHidePermissions(_ permissions: [Permission]) {} -} diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/App Icon Mask.imageset/Contents.json b/Sources/PermissionsKit/Resources/Assets.xcassets/App Icon Mask.imageset/Contents.json deleted file mode 100644 index 4d69822..0000000 --- a/Sources/PermissionsKit/Resources/Assets.xcassets/App Icon Mask.imageset/Contents.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "images" : [ - { - "filename" : "app.fill.pdf", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - }, - "properties" : { - "preserves-vector-representation" : true - } -} diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/App Icon Mask.imageset/app.fill.pdf b/Sources/PermissionsKit/Resources/Assets.xcassets/App Icon Mask.imageset/app.fill.pdf deleted file mode 100644 index b947031..0000000 Binary files a/Sources/PermissionsKit/Resources/Assets.xcassets/App Icon Mask.imageset/app.fill.pdf and /dev/null differ diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Contents.json b/Sources/PermissionsKit/Resources/Assets.xcassets/Contents.json deleted file mode 100644 index 73c0059..0000000 --- a/Sources/PermissionsKit/Resources/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Bluetooth.imageset/Bluetooth.pdf b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Bluetooth.imageset/Bluetooth.pdf deleted file mode 100644 index 58a160a..0000000 Binary files a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Bluetooth.imageset/Bluetooth.pdf and /dev/null differ diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Bluetooth.imageset/Contents.json b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Bluetooth.imageset/Contents.json deleted file mode 100644 index 97462ec..0000000 --- a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Bluetooth.imageset/Contents.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "images" : [ - { - "filename" : "Bluetooth.pdf", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - }, - "properties" : { - "preserves-vector-representation" : true - } -} diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Calendar.imageset/Calendar.pdf b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Calendar.imageset/Calendar.pdf deleted file mode 100644 index 11196bb..0000000 Binary files a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Calendar.imageset/Calendar.pdf and /dev/null differ diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Calendar.imageset/Contents.json b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Calendar.imageset/Contents.json deleted file mode 100644 index 85f96f7..0000000 --- a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Calendar.imageset/Contents.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "images" : [ - { - "filename" : "Calendar.pdf", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - }, - "properties" : { - "preserves-vector-representation" : true - } -} diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Camera.imageset/Camera.pdf b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Camera.imageset/Camera.pdf deleted file mode 100644 index 0e96624..0000000 Binary files a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Camera.imageset/Camera.pdf and /dev/null differ diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Camera.imageset/Contents.json b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Camera.imageset/Contents.json deleted file mode 100644 index b0a9f52..0000000 --- a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Camera.imageset/Contents.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "images" : [ - { - "filename" : "Camera.pdf", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - }, - "properties" : { - "preserves-vector-representation" : true - } -} diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Contacts.imageset/Contacts.pdf b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Contacts.imageset/Contacts.pdf deleted file mode 100644 index be9d4cd..0000000 Binary files a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Contacts.imageset/Contacts.pdf and /dev/null differ diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Contacts.imageset/Contents.json b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Contacts.imageset/Contents.json deleted file mode 100644 index 5c5d3f1..0000000 --- a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Contacts.imageset/Contents.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "images" : [ - { - "filename" : "Contacts.pdf", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - }, - "properties" : { - "preserves-vector-representation" : true - } -} diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Contents.json b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Contents.json deleted file mode 100644 index 73c0059..0000000 --- a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/FaceID.imageset/Contents.json b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/FaceID.imageset/Contents.json deleted file mode 100644 index 41ce4b2..0000000 --- a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/FaceID.imageset/Contents.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "images" : [ - { - "filename" : "FaceID.pdf", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - }, - "properties" : { - "preserves-vector-representation" : true - } -} diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/FaceID.imageset/FaceID.pdf b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/FaceID.imageset/FaceID.pdf deleted file mode 100644 index 375effa..0000000 Binary files a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/FaceID.imageset/FaceID.pdf and /dev/null differ diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Health.imageset/Contents.json b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Health.imageset/Contents.json deleted file mode 100644 index 5963187..0000000 --- a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Health.imageset/Contents.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "images" : [ - { - "filename" : "Health.pdf", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - }, - "properties" : { - "preserves-vector-representation" : true - } -} diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Health.imageset/Health.pdf b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Health.imageset/Health.pdf deleted file mode 100644 index e82b72c..0000000 Binary files a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Health.imageset/Health.pdf and /dev/null differ diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Home.imageset/Contents.json b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Home.imageset/Contents.json deleted file mode 100644 index acea023..0000000 --- a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Home.imageset/Contents.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x" - }, - { - "filename" : "Home@2x.png", - "idiom" : "universal", - "scale" : "2x" - }, - { - "filename" : "Home@3x.png", - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Home.imageset/Home@2x.png b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Home.imageset/Home@2x.png deleted file mode 100644 index a55609e..0000000 Binary files a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Home.imageset/Home@2x.png and /dev/null differ diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Home.imageset/Home@3x.png b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Home.imageset/Home@3x.png deleted file mode 100644 index 97b04f9..0000000 Binary files a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Home.imageset/Home@3x.png and /dev/null differ diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Local Network.imageset/Contents.json b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Local Network.imageset/Contents.json deleted file mode 100644 index 7dacf8e..0000000 --- a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Local Network.imageset/Contents.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x" - }, - { - "filename" : "LocalNetwork@2x.png", - "idiom" : "universal", - "scale" : "2x" - }, - { - "filename" : "LocalNetwork@3x.png", - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Local Network.imageset/LocalNetwork@2x.png b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Local Network.imageset/LocalNetwork@2x.png deleted file mode 100644 index a4d9d81..0000000 Binary files a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Local Network.imageset/LocalNetwork@2x.png and /dev/null differ diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Local Network.imageset/LocalNetwork@3x.png b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Local Network.imageset/LocalNetwork@3x.png deleted file mode 100644 index bbe7082..0000000 Binary files a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Local Network.imageset/LocalNetwork@3x.png and /dev/null differ diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Location.imageset/Contents.json b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Location.imageset/Contents.json deleted file mode 100644 index 40604c7..0000000 --- a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Location.imageset/Contents.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "images" : [ - { - "filename" : "Location.pdf", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - }, - "properties" : { - "preserves-vector-representation" : true - } -} diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Location.imageset/Location.pdf b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Location.imageset/Location.pdf deleted file mode 100644 index 80e8b7e..0000000 Binary files a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Location.imageset/Location.pdf and /dev/null differ diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Media Library.imageset/Contents.json b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Media Library.imageset/Contents.json deleted file mode 100644 index 1a9198b..0000000 --- a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Media Library.imageset/Contents.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "images" : [ - { - "filename" : "Media Library.pdf", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - }, - "properties" : { - "preserves-vector-representation" : true - } -} diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Media Library.imageset/Media Library.pdf b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Media Library.imageset/Media Library.pdf deleted file mode 100644 index a8c8e5d..0000000 Binary files a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Media Library.imageset/Media Library.pdf and /dev/null differ diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Microphone.imageset/Contents.json b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Microphone.imageset/Contents.json deleted file mode 100644 index 7522eee..0000000 --- a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Microphone.imageset/Contents.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "images" : [ - { - "filename" : "Microphone.pdf", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - }, - "properties" : { - "preserves-vector-representation" : true - } -} diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Microphone.imageset/Microphone.pdf b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Microphone.imageset/Microphone.pdf deleted file mode 100644 index 40bc0a0..0000000 Binary files a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Microphone.imageset/Microphone.pdf and /dev/null differ diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Motion.imageset/Contents.json b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Motion.imageset/Contents.json deleted file mode 100644 index a9c80ce..0000000 --- a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Motion.imageset/Contents.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "images" : [ - { - "filename" : "Motion.pdf", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - }, - "properties" : { - "preserves-vector-representation" : true - } -} diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Motion.imageset/Motion.pdf b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Motion.imageset/Motion.pdf deleted file mode 100644 index 973e2c9..0000000 Binary files a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Motion.imageset/Motion.pdf and /dev/null differ diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Notifications.imageset/Contents.json b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Notifications.imageset/Contents.json deleted file mode 100644 index df748bd..0000000 --- a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Notifications.imageset/Contents.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "images" : [ - { - "filename" : "Notifications.pdf", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - }, - "properties" : { - "preserves-vector-representation" : true - } -} diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Notifications.imageset/Notifications.pdf b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Notifications.imageset/Notifications.pdf deleted file mode 100644 index 452d2c1..0000000 Binary files a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Notifications.imageset/Notifications.pdf and /dev/null differ diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Photos.imageset/Contents.json b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Photos.imageset/Contents.json deleted file mode 100644 index b407ace..0000000 --- a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Photos.imageset/Contents.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "images" : [ - { - "filename" : "Photos.pdf", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - }, - "properties" : { - "preserves-vector-representation" : true - } -} diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Photos.imageset/Photos.pdf b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Photos.imageset/Photos.pdf deleted file mode 100644 index 9b1b11b..0000000 Binary files a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Photos.imageset/Photos.pdf and /dev/null differ diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Privacy.imageset/Contents.json b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Privacy.imageset/Contents.json deleted file mode 100644 index 53d77a9..0000000 --- a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Privacy.imageset/Contents.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "images" : [ - { - "filename" : "Privacy.pdf", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - }, - "properties" : { - "preserves-vector-representation" : true - } -} diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Privacy.imageset/Privacy.pdf b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Privacy.imageset/Privacy.pdf deleted file mode 100644 index bc3e9b0..0000000 Binary files a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Privacy.imageset/Privacy.pdf and /dev/null differ diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Reminders.imageset/Contents.json b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Reminders.imageset/Contents.json deleted file mode 100644 index 3e4d938..0000000 --- a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Reminders.imageset/Contents.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "images" : [ - { - "filename" : "Reminders.pdf", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - }, - "properties" : { - "preserves-vector-representation" : true - } -} diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Reminders.imageset/Reminders.pdf b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Reminders.imageset/Reminders.pdf deleted file mode 100644 index dfb301b..0000000 Binary files a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Reminders.imageset/Reminders.pdf and /dev/null differ diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Siri.imageset/Contents.json b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Siri.imageset/Contents.json deleted file mode 100644 index 59d8ae8..0000000 --- a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Siri.imageset/Contents.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "images" : [ - { - "filename" : "Siri.pdf", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - }, - "properties" : { - "preserves-vector-representation" : true - } -} diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Siri.imageset/Siri.pdf b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Siri.imageset/Siri.pdf deleted file mode 100644 index ef1176c..0000000 Binary files a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Siri.imageset/Siri.pdf and /dev/null differ diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Speech Recognition.imageset/Contents.json b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Speech Recognition.imageset/Contents.json deleted file mode 100644 index dccdd79..0000000 --- a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Speech Recognition.imageset/Contents.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "images" : [ - { - "filename" : "Speech Recognition.pdf", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - }, - "properties" : { - "preserves-vector-representation" : true - } -} diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Speech Recognition.imageset/Speech Recognition.pdf b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Speech Recognition.imageset/Speech Recognition.pdf deleted file mode 100644 index 54c222d..0000000 Binary files a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Speech Recognition.imageset/Speech Recognition.pdf and /dev/null differ diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Tracking.imageset/Contents.json b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Tracking.imageset/Contents.json deleted file mode 100644 index 4a5a3a5..0000000 --- a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Tracking.imageset/Contents.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "images" : [ - { - "filename" : "Tracking.pdf", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - }, - "properties" : { - "preserves-vector-representation" : true - } -} diff --git a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Tracking.imageset/Tracking.pdf b/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Tracking.imageset/Tracking.pdf deleted file mode 100644 index 96b5601..0000000 Binary files a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Tracking.imageset/Tracking.pdf and /dev/null differ diff --git a/Sources/PermissionsKit/Resources/Localization/ar.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/ar.lproj/Localizable.strings deleted file mode 100644 index 76af0ec..0000000 --- a/Sources/PermissionsKit/Resources/Localization/ar.lproj/Localizable.strings +++ /dev/null @@ -1,89 +0,0 @@ -"action allow" = "استمرار"; - -"action allowed" = "تم السماح"; - -"titles header" = "إدارة الصلاحيات"; - -"titles sub header" = "الصلاحيات"; - -"titles description" = "هذه الصلاحيات التي يتطلبها التطبيق ليعمل بشكل صحيح."; - -"titles comment" = "منح الصلاحيات يمكنك من تحقيق أقصى إستفادة من مميزات التطبيق"; - -"permission camera name" = "الكاميرا"; - -"permission camera description" = "السماح للتطبيق بالوصول الى الكاميرا"; - -"permission photoLibrary name" = "الاستوديو"; - -"permission photoLibrary description" = "ليتمكن التطبيق من حفظ او استيراد الصور من والى الاستوديو"; - -"permission microphone name" = "المايكروفون"; - -"permission microphone description" = "السماح بإستخدام المايكروفون"; - -"permission calendar name" = "التقويم"; - -"permission calendar description" = "السماح بالوصول الكامل الى التقويم"; - -"permission contacts name" = "جهات الاتصال"; - -"permission contacts description" = "الوصول إلى جهات الاتصال"; - -"permission reminders name" = "التذكيرات"; - -"permission reminders description" = "السماح للتطبيق بالوصول الكامل الى التذكيرات"; - -"permission speech name" = "التحدث"; - -"permission speech description" = "السماح بالتحقق من صوتك"; - -"permission motion name" = "الحركة"; - -"permission motion description" = "السماح بتسجيل البيانات المتعلقة بالحركة والبيئة"; - -"permission media library name" = "الموسيقى"; - -"permission media library description" = "السماح للوصول الى مكتبة الموسيقى"; - -"permission bluetooth name" = "البلوتوث"; - -"permission bluetooth description" = "السماح بإستخدام البلوتوث"; - -"permission notification name" = "الإشعارات"; - -"permission notification description" = "لإستقبال التنبيهات دون فتح التطبيق."; - -"permission location when in use name" = "الموقع عند الاستخدام"; - -"permission location when in use description" = "السماح للوصول إلى موقعك عند استخدام التطبيق فقط"; - -"permission location always name" = "الموقع دائما"; - -"permission location always description" = "السماح دائماً للوصول إلى موقعك"; - -"permission tracking name" = "تتبع"; - -"permission tracking description" = "السماح بالوصول إلى البيانات المتعلقة بالتطبيق"; - -"permission faceid name" = "FaceID"; - -"permission faceid description" = "السماح باستخدام بصمة الوجه Face ID"; - -"permission siri name" = "سيري"; - -"permission siri description" = "تمكين استخدام سيري"; - -"permission health name" = "الصحة"; - -"permission health description" = "السماح بالوصول إلى البيانات الصحية"; - -"denied alert title" = "تعديل الرفض"; - -"denied alert description" = "لإعادة منح الصلاحيات يرجى الذهاب الى الإعدادات"; - -"denied alert action" = "الذهاب الى الإعدادات"; - -"denied alert cancel" = "الغاء"; - -"action denied" = "تم الرفض"; diff --git a/Sources/PermissionsKit/Resources/Localization/de.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/de.lproj/Localizable.strings deleted file mode 100644 index e0673f4..0000000 --- a/Sources/PermissionsKit/Resources/Localization/de.lproj/Localizable.strings +++ /dev/null @@ -1,89 +0,0 @@ -"action allow" = "Fortsetzen"; - -"action allowed" = "Dürfen"; - -"titles header" = "Benötigen Sie die Erlaubnis"; - -"titles sub header" = "Berechtigungsanfrage"; - -"titles description" = "Dies sind die Berechtigungen, die die App benötigt, um richtig zu funktionieren. Bitte lesen Sie die Beschreibung für jede Berechtigung."; - -"titles comment" = "Berechtigungen sind notwendig, damit die Anwendung funktioniert und korrekt arbeitet. Push sind nicht erforderliche Berechtigungen"; - -"permission camera name" = "Kamera"; - -"permission camera description" = "App zur Verwendung der Kamera zulassen"; - -"permission photoLibrary name" = "Foto-Bibliothek"; - -"permission photoLibrary description" = "Zugang zum Speichern von Fotos in Ihrer Galerie"; - -"permission microphone name" = "Mikrofon"; - -"permission microphone description" = "Sprachaufzeichnung aus der App heraus zulassen"; - -"permission calendar name" = "Kalender"; - -"permission calendar description" = "Anwendung kann Ereignisse zum Kalender hinzufügen"; - -"permission contacts name" = "Kontakte"; - -"permission contacts description" = "Zugriff für Ihre Kontakte und Telefone"; - -"permission reminders name" = "Mahnungen"; - -"permission reminders description" = "Anwendung kann neue Aufgabe erstellen"; - -"permission speech name" = "Sprechen"; - -"permission speech description" = "Erlauben Sie die Überprüfung Ihrer Stimme"; - -"permission motion name" = "Bewegung"; - -"permission motion description" = "Erlaubt die Aufzeichnung von bewegungs- und umgebungsbezogenen Daten"; - -"permission media library name" = "Medienbibliothek"; - -"permission media library description" = "Erlauben Sie die Überprüfung Ihrer Medien"; - -"permission bluetooth name" = "Bluetooth"; - -"permission bluetooth description" = "Zugriff auf Bluetooth zulassen"; - -"permission notification name" = "Benachrichtigung"; - -"permission notification description" = "Erhalten Sie wichtige Informationen, ohne die App zu öffnen."; - -"permission location when in use name" = "Standort bei Verwendung"; - -"permission location when in use description" = "Erlauben Sie den Zugriff auf Ihren Standort"; - -"permission location always name" = "Standort Immer"; - -"permission location always description" = "Erlauben Sie den Zugriff auf Ihren Standort"; - -"permission tracking name" = "Nachverfolgung"; - -"permission tracking description" = "Zugriff auf app-bezogene Daten zulassen"; - -"permission faceid name" = "FaceID"; - -"permission faceid description" = "Erlauben Sie die Verwendung der Face ID-Identität"; - -"permission siri name" = "Siri"; - -"permission siri description" = "Sie werden Siri verwenden können"; - -"permission health name" = "Gesundheit"; - -"permission health description" = "Zugriff auf Gesundheitsdaten zulassen"; - -"denied alert title" = "Berechtigung verweigert"; - -"denied alert description" = "Bitte gehen Sie zu Einstellungen und erlauben Sie die Erlaubnis."; - -"denied alert action" = "Einstellungen"; - -"denied alert cancel" = "Abbrechen"; - -"action denied" = "Abgelehnt"; diff --git a/Sources/PermissionsKit/Resources/Localization/en.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/en.lproj/Localizable.strings deleted file mode 100644 index 7771ffa..0000000 --- a/Sources/PermissionsKit/Resources/Localization/en.lproj/Localizable.strings +++ /dev/null @@ -1,89 +0,0 @@ -"action allow" = "Continue"; - -"action allowed" = "Allowed"; - -"titles header" = "Need Permission"; - -"titles sub header" = "Permissions request"; - -"titles description" = "These are the permissions the app requires to work properly. Please see description for each permission."; - -"titles comment" = "Permissions are necessary for the application to work and perform correctly. Push are not required permissions"; - -"permission camera name" = "Camera"; - -"permission camera description" = "Allow app for use camera"; - -"permission photoLibrary name" = "Photo Library"; - -"permission photoLibrary description" = "Access for save photos in your gallery"; - -"permission microphone name" = "Microphone"; - -"permission microphone description" = "Allow record voice from app"; - -"permission calendar name" = "Calendar"; - -"permission calendar description" = "Application can add events to calendar"; - -"permission contacts name" = "Contacts"; - -"permission contacts description" = "Access for your contacts and phones"; - -"permission reminders name" = "Reminders"; - -"permission reminders description" = "Application can create new task"; - -"permission speech name" = "Speech"; - -"permission speech description" = "Allow to check your voice"; - -"permission motion name" = "Motion"; - -"permission motion description" = "Allow to record motion and environment-related data"; - -"permission media library name" = "Media Library"; - -"permission media library description" = "Allow to check your media"; - -"permission bluetooth name" = "Bluetooth"; - -"permission bluetooth description" = "Allow access to bluetooth"; - -"permission notification name" = "Notification"; - -"permission notification description" = "Get important information without opening app."; - -"permission location when in use name" = "Location When Use"; - -"permission location when in use description" = "Allow to access your location"; - -"permission location always name" = "Location Always"; - -"permission location always description" = "Allow to access your location"; - -"permission tracking name" = "Tracking"; - -"permission tracking description" = "Allow to access app-related data"; - -"permission faceid name" = "FaceID"; - -"permission faceid description" = "Allow using Face ID identity"; - -"permission siri name" = "Siri"; - -"permission siri description" = "You will be able to use Siri"; - -"permission health name" = "Health"; - -"permission health description" = "Allow to access health data"; - -"denied alert title" = "Permission denied"; - -"denied alert description" = "Please, go to Settings and allow permission."; - -"denied alert action" = "Settings"; - -"denied alert cancel" = "Cancel"; - -"action denied" = "Denied"; diff --git a/Sources/PermissionsKit/Resources/Localization/es.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/es.lproj/Localizable.strings deleted file mode 100644 index 18f7aec..0000000 --- a/Sources/PermissionsKit/Resources/Localization/es.lproj/Localizable.strings +++ /dev/null @@ -1,90 +0,0 @@ -"action allow" = "Continuar"; - -"action allowed" = "Permitido"; - -"titles header" = "Necesita permiso"; - -"titles sub header" = "Solicitud de permisos"; - -"titles description" = "Estos son los permisos que la aplicación requiere para funcionar correctamente. Consulte la descripción de cada permiso."; - -"titles comment" = "Los permisos son necesarios para que la aplicación funcione y se desempeñe correctamente. Los permisos Push no son necesarios"; - -"permission camera name" = "Cámara"; - -"permission camera description" = "Permitir que la aplicación utilice la cámara"; - -"permission photoLibrary name" = "Biblioteca fotográfica"; - -"permission photoLibrary description" = "Acceso para guardar fotos en tu galería"; - -"permission microphone name" = "Micrófono"; - -"permission microphone description" = "Permitir la grabación de voz desde la aplicación"; - -"permission calendar name" = "Calendario"; - -"permission calendar description" = "La aplicación puede añadir eventos al calendario"; - -"permission contacts name" = "Contactos"; - -"permission contacts description" = "Acceso para sus contactos y teléfonos"; - -"permission reminders name" = "Recordatorios"; - -"permission reminders description" = "La aplicación puede crear una nueva tarea"; - -"permission speech name" = "Discurso"; - -"permission speech description" = "Permitir comprobar su voz"; - -"permission motion name" = "Movimiento"; - -"permission motion description" = "Permite registrar datos relacionados con el movimiento y el entorno"; - -"permission media library name" = "Biblioteca de medios de comunicación"; - -"permission media library description" = "Permitir la comprobación de los medios de comunicación"; - -"permission bluetooth name" = "Bluetooth"; - -"permission bluetooth description" = "Permitir el acceso al bluetooth"; - -"permission notification name" = "Notificación"; - -"permission notification description" = "Obtenga información importante sin abrir la aplicación."; - -"permission location when in use name" = "Ubicación cuando se usa"; - -"permission location when in use description" = "Allow to access your location"; - -"permission location always name" = "Ubicación Siempre"; - -"permission location always description" = "Permitir el acceso a su ubicación -"; - -"permission tracking name" = "Seguimiento de"; - -"permission tracking description" = "Permitir el acceso a los datos relacionados con la aplicación"; - -"permission faceid name" = "FaceID"; - -"permission faceid description" = "Permitir el uso de la identidad de Face ID"; - -"permission siri name" = "Siri"; - -"permission siri description" = "Podrá utilizar Siri"; - -"permission health name" = "Salud"; - -"permission health description" = "Permitir el acceso a los datos de salud"; - -"denied alert title" = "Permiso denegado"; - -"denied alert description" = "Por favor, vaya a Configuración y permita el permiso."; - -"denied alert action" = "Ajustes"; - -"denied alert cancel" = "Cancelar"; - -"action denied" = "Negado"; diff --git a/Sources/PermissionsKit/Resources/Localization/fa.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/fa.lproj/Localizable.strings deleted file mode 100644 index ac3330a..0000000 --- a/Sources/PermissionsKit/Resources/Localization/fa.lproj/Localizable.strings +++ /dev/null @@ -1,89 +0,0 @@ -"action allow" = "ادامه"; - -"action allowed" = "مجاز"; - -"titles header" = "نیاز به مجوز"; - -"titles sub header" = "درخواست مجوز"; - -"titles description" = "اینها مجوزهایی هستند که برنامه برای درست کار کردن نیاز دارد. لطفاً توضیحات مربوط به هر مجوز را ببینید."; - -"titles comment" = "مجوزها برای کار و عملکرد صحیح برنامه ضروری هستند. اعلانات مجوزهای ضروری نیستند"; - -"permission camera name" = "دوربین"; - -"permission camera description" = "اجازه دادن به برنامه برای استفاده از دوربین"; - -"permission photoLibrary name" = "گالری"; - -"permission photoLibrary description" = "دسترسی برای ذخیره عکس ها در گالری"; - -"permission microphone name" = "میکروفون"; - -"permission microphone description" = "اجازه ضبط صدا به برنامه"; - -"permission calendar name" = "تقویم"; - -"permission calendar description" = "برنامه می تواند رویدادها را به تقویم اضافه کند"; - -"permission contacts name" = "مخاطبین"; - -"permission contacts description" = "دسترسی برای مخاطبین و تلفن های شما"; - -"permission reminders name" = "یادآوری ها"; - -"permission reminders description" = "برنامه می تواند تسک جدیدی ایجاد کند"; - -"permission speech name" = "گفتار"; - -"permission speech description" = "اجازه ضبط صدای شما"; - -"permission motion name" = "حرکت"; - -"permission motion description" = "اجازه ضبط حرکت و داده های مربوط به محیط را فراهم می کند"; - -"permission media library name" = "مدیا"; - -"permission media library description" = "اجازه بررسی مدیا شما"; - -"permission bluetooth name" = "بلوتوث"; - -"permission bluetooth description" = "اجازه دسترسی به بلوتوث"; - -"permission notification name" = "اعلانات"; - -"permission notification description" = "اطلاعات مهم را بدون باز کردن برنامه دریافت کنید."; - -"permission location when in use name" = "موقعیت مکانی هنگام استفاده"; - -"permission location when in use description" = "اجازه دسترسی به موقعیت مکانی شما"; - -"permission location always name" = "موقعیت مکانی همیشه"; - -"permission location always description" = "اجازه دسترسی به موقعیت مکانی شما"; - -"permission tracking name" = "ردیابی"; - -"permission tracking description" = "اجازه دسترسی به داده های مربوط به برنامه"; - -"permission faceid name" = "FaceID"; - -"permission faceid description" = "اجازه استفاده از شناسه Face ID"; - -"permission siri name" = "سیری"; - -"permission siri description" = "شما می توانید از سیری استفاده کنید"; - -"permission health name" = "سلامت"; - -"permission health description" = "اجازه دسترسی به داده های سلامت"; - -"denied alert title" = "مجوز رد شد"; - -"denied alert description" = "لطفاً به تنظیمات بروید و مجوز بدهید."; - -"denied alert action" = "تنظیمات"; - -"denied alert cancel" = "لغو"; - -"action denied" = "رد شد"; diff --git a/Sources/PermissionsKit/Resources/Localization/fr.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/fr.lproj/Localizable.strings deleted file mode 100644 index 5e834d0..0000000 --- a/Sources/PermissionsKit/Resources/Localization/fr.lproj/Localizable.strings +++ /dev/null @@ -1,89 +0,0 @@ -"action allow" = "Continuer"; - -"action allowed" = "Autorisé"; - -"titles header" = "Besoin d'une autorisation"; - -"titles sub header" = "Demande de permissions"; - -"titles description" = "Il s'agit des autorisations dont l'application a besoin pour fonctionner correctement. Veuillez consulter la description de chaque autorisation."; - -"titles comment" = "Les permissions sont nécessaires pour que l'application fonctionne et s'exécute correctement. Les permissions ne sont pas nécessaires"; - -"permission camera name" = "Caméra"; - -"permission camera description" = "Autoriser l'application à utiliser la caméra"; - -"permission photoLibrary name" = "Photothèque"; - -"permission photoLibrary description" = "Accès pour sauvegarder les photos dans votre galerie"; - -"permission microphone name" = "Microphone"; - -"permission microphone description" = "Permet d'enregistrer la voix à partir de l'application"; - -"permission calendar name" = "Calendrier"; - -"permission calendar description" = "L'application peut ajouter des événements au calendrier"; - -"permission contacts name" = "Contacts"; - -"permission contacts description" = "Accès à vos contacts et téléphones"; - -"permission reminders name" = "Rappels"; - -"permission reminders description" = "L'application peut créer une nouvelle tâche"; - -"permission speech name" = "Voix"; - -"permission speech description" = "Permet de vérifier votre voix"; - -"permission motion name" = "Mouvement"; - -"permission motion description" = "Permet d'enregistrer les mouvements et les données liées à l'environnement"; - -"permission media library name" = "Médiathèque"; - -"permission media library description" = "Permet de vérifier vos médias"; - -"permission bluetooth name" = "Bluetooth"; - -"permission bluetooth description" = "Permet d'accéder à Bluetooth"; - -"permission notification name" = "Notification"; - -"permission notification description" = "Obtenez des informations importantes sans ouvrir l'application."; - -"permission location when in use name" = "Localisation lors de l'utilisation"; - -"permission location when in use description" = "Autorisez l'accès à votre localisation"; - -"permission location always name" = "Localisation Toujours"; - -"permission location always description" = "Autorisez l'accès à votre emplacement"; - -"permission tracking name" = "Suivi du site"; - -"permission tracking description" = "Autoriser l'accès aux données liées à l'application"; - -"permission faceid name" = "FaceID"; - -"permission faceid description" = "Autoriser l'utilisation de l'identité Face ID"; - -"permission siri name" = "Siri"; - -"permission siri description" = "Vous pourrez utiliser Siri"; - -"permission health name" = "Santé"; - -"permission health description" = "Permettre d'accéder aux données de santé"; - -"denied alert title" = "Permission refusée"; - -"denied alert description" = "Veuillez aller dans Paramètres et autoriser la permission."; - -"denied alert action" = "Paramètres"; - -"denied alert cancel" = "Annuler"; - -"action denied" = "Refusé"; diff --git a/Sources/PermissionsKit/Resources/Localization/it.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/it.lproj/Localizable.strings deleted file mode 100644 index 85cea27..0000000 --- a/Sources/PermissionsKit/Resources/Localization/it.lproj/Localizable.strings +++ /dev/null @@ -1,89 +0,0 @@ -"action allow" = "Continua"; - -"action allowed" = "Permesso"; - -"titles header" = "Need Permission"; - -"titles sub header" = "Richiesta permessi"; - -"titles description" = "Questi sono i permessi che l'app richiede per funzionare correttamente. Si prega di vedere la descrizione per ogni permesso"; - -"titles comment" = "I permessi sono necessari affinché l'applicazione funzioni e funzioni correttamente. Spingere non sono permessi richiesti"; - -"permission camera name" = "Camera"; - -"permission camera description" = "Permetti all'app di usare la fotocamera"; - -"permission photoLibrary name" = "Photo Library"; - -"permission photoLibrary description" = "Accesso per salvare le foto nella tua galleria"; - -"permission microphone name" = "Microphone"; - -"permission microphone description" = "Permettere di registrare la voce dall'app"; - -"permission calendar name" = "Calendar"; - -"permission calendar description" = "L'applicazione può aggiungere eventi al calendario"; - -"permission contacts name" = "Contacts"; - -"permission contacts description" = "Accesso per i tuoi contatti e telefoni"; - -"permission reminders name" = "Reminders"; - -"permission reminders description" = "Application can create new task"; - -"permission speech name" = "Speech"; - -"permission speech description" = "Permetti di controllare la tua voce"; - -"permission motion name" = "Motion"; - -"permission motion description" = "Allow to record motion and environment-related data"; - -"permission media library name" = "Media Library"; - -"permission media library description" = "Allow to check your media"; - -"permission bluetooth name" = "Bluetooth"; - -"permission bluetooth description" = "Permettere l'accesso al bluetooth"; - -"permission notification name" = "Notification"; - -"permission notification description" = "Ottieni informazioni importanti senza aprire l'app"; - -"permission location when in use name" = "Location When Use"; - -"permission location when in use description" = "Consenti l'accesso alla tua posizione"; - -"permission location always name" = "Posizione sempre"; - -"permission location always description" = "Consenti di accedere alla tua posizione"; - -"permission tracking name" = "Tracking"; - -"permission tracking description" = "Consenti di accedere ai dati relativi all'app"; - -"permission faceid name" = "FaceID"; - -"permission faceid description" = "Permettere di utilizzare l'identità di Face ID"; - -"permission siri name" = "Siri"; - -"permission siri description" = "Sarà possibile utilizzare Siri"; - -"permission health name" = "Salute"; - -"permission health description" = "Consenti l'accesso ai dati sanitari"; - -"denied alert title" = "Permesso negato"; - -"denied alert description" = "Per favore, vai su Impostazioni e autorizza il permesso"; - -"denied alert action" = "Impostazioni"; - -"denied alert cancel" = "Annulla"; - -"action denied" = "Negato"; diff --git a/Sources/PermissionsKit/Resources/Localization/nl.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/nl.lproj/Localizable.strings deleted file mode 100644 index 46e285f..0000000 --- a/Sources/PermissionsKit/Resources/Localization/nl.lproj/Localizable.strings +++ /dev/null @@ -1,89 +0,0 @@ -"action allow" = "Doorgaan"; - -"action allowed" = "Toegestaan"; - -"titles header" = "Toestemming vereist"; - -"titles sub header" = "Machtigingsverzoek"; - -"titles description" = "Dit zijn de machtigingen die de app nodig heeft om goed te werken. Zie de beschrijving voor elke machtiging."; - -"titles comment" = "Machtigingen zijn nodig om de toepassing correct te laten werken en uit te voeren. Push zijn geen vereiste machtigingen"; - -"permission camera name" = "Camera"; - -"permission camera description" = "App toestaan ​​voor gebruik camera"; - -"permission photoLibrary name" = "Foto Bibliotheek"; - -"permission photoLibrary description" = "Toegang om foto's in uw galerij op te slaan"; - -"permission microphone name" = "Microfoon"; - -"permission microphone description" = "Opname stem vanuit app toestaan"; - -"permission calendar name" = "Kalender"; - -"permission calendar description" = "Applicatie kan evenementen toevoegen aan kalender"; - -"permission contacts name" = "Contacten"; - -"permission contacts description" = "Toegang tot uw contacten en telefoonnummers"; - -"permission reminders name" = "Herinneringen"; - -"permission reminders description" = "Toepassing kan nieuwe taak maken"; - -"permission speech name" = "Spraak"; - -"permission speech description" = "Sta toe om je stem te controleren"; - -"permission motion name" = "Beweging"; - -"permission motion description" = "Sta toe om bewegings- en omgevingsgerelateerde gegevens op te nemen"; - -"permission media library name" = "Media Bibliotheek"; - -"permission media library description" = "Toestaan ​​om uw media te controleren"; - -"permission bluetooth name" = "Bluetooth"; - -"permission bluetooth description" = "Toegang tot bluetooth toestaan"; - -"permission notification name" = "Notificatie"; - -"permission notification description" = "Krijg belangrijke informatie zonder de app te openen."; - -"permission location when in use name" = "Locatie tijdens gebruik"; - -"permission location when in use description" = "Toegang tot uw locatie toestaan"; - -"permission location always name" = "Locatie Altijd"; - -"permission location always description" = "Toegang tot uw locatie toestaan"; - -"permission tracking name" = "Volgen"; - -"permission tracking description" = "Toegang geven tot app-gerelateerde gegevens"; - -"permission faceid name" = "FaceID"; - -"permission faceid description" = "Gebruik van Face ID-identiteit toestaan"; - -"permission siri name" = "Siri"; - -"permission siri description" = "U kunt Siri gebruiken"; - -"permission health name" = "Gezondheid"; - -"permission health description" = "Toegang geven tot gezondheidsgegevens"; - -"denied alert title" = "Toestemming geweigerd"; - -"denied alert description" = "Ga naar Instellingen en geef toestemming."; - -"denied alert action" = "Instellingen"; - -"denied alert cancel" = "Annuleren"; - -"action denied" = "Afgewezen"; diff --git a/Sources/PermissionsKit/Resources/Localization/pl.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/pl.lproj/Localizable.strings deleted file mode 100644 index b607ad1..0000000 --- a/Sources/PermissionsKit/Resources/Localization/pl.lproj/Localizable.strings +++ /dev/null @@ -1,89 +0,0 @@ -"action allow" = "Kontyntynuj"; - -"action allowed" = "Dozwolone"; - -"titles header" = "Potrzebne zezwolenie"; - -"titles sub header" = "Żądanie uprawnień"; - -"titles description" = "To są uprawnienia, których aplikacja wymaga do poprawnego działania. Proszę zobaczyć opis dla każdego uprawnienia."; - -"titles comment" = "Uprawnienia są niezbędne do prawidłowego działania aplikacji. Push nie są wymagane uprawnienia"; - -"permission camera name" = "Kamera"; - -"permission camera description" = "Zezwól aplikacji na korzystanie z aparatu"; - -"permission photoLibrary name" = "Biblioteka zdjęć"; - -"permission photoLibrary description" = "Dostęp do zapisywania zdjęć w galerii"; - -"permission microphone name" = "Mikrofon"; - -"permission microphone description" = "Umożliwia nagrywanie głosu z aplikacji"; - -"permission calendar name" = "Kalendarz"; - -"permission calendar description" = "Aplikacja może dodawać wydarzenia do kalendarza"; - -"permission contacts name" = "Kontakty"; - -"permission contacts description" = "Dostęp do kontaktów i telefonów"; - -"permission reminders name" = "Przypomnienia"; - -"permission reminders description" = "Aplikacja może tworzyć nowe zadania"; - -"permission speech name" = "Mowa"; - -"permission speech description" = "Umożliwia sprawdzanie głosu"; - -"permission motion name" = "Motion"; - -"permission motion description" = "Umożliwia rejestrowanie ruchu i danych związanych z otoczeniem"; - -"permission media library name" = "Biblioteka mediów"; - -"permission media library description" = "Umożliwia sprawdzanie multimediów."; - -"permission bluetooth name" = "Bluetooth"; - -"permission bluetooth description" = "Zezwalaj na dostęp do bluetooth"; - -"permission notification name" = "Powiadomienia"; - -"permission notification description" = "Otrzymuj ważne informacje bez otwierania aplikacji."; - -"permission location when in use name" = "Lokalizacja podczas używania"; - -"permission location when in use description" = "Zezwól na dostęp do swojej lokalizacji."; - -"permission location always name" = "Lokalizacja zawsze"; - -"permission location always description" = "Zezwalaj na dostęp do swojej lokalizacji"; - -"permission tracking name" = "Śledzenie"; - -"permission tracking description" = "Zezwalaj na dostęp do danych związanych z aplikacją"; - -"permission faceid name" = "FaceID"; - -"permission faceid description" = "Zezwalaj na używanie tożsamości Face ID"; - -"permission siri name" = "Siri"; - -"permission siri description" = "Będziesz mógł korzystać z Siri"; - -"permission health name" = "Zdrowie"; - -"permission health description" = "Zezwalaj na dostęp do danych dotyczących zdrowia"; - -"denied alert title" = "Odmowa pozwolenia"; - -"denied alert description" = "Proszę przejść do Ustawień i zezwolić na dostęp."; - -"denied alert action" = "Ustawienia"; - -"denied alert cancel" = "Anuluj"; - -"action denied" = "Odmówiono"; diff --git a/Sources/PermissionsKit/Resources/Localization/pt.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/pt.lproj/Localizable.strings deleted file mode 100644 index 3ed356d..0000000 --- a/Sources/PermissionsKit/Resources/Localization/pt.lproj/Localizable.strings +++ /dev/null @@ -1,89 +0,0 @@ -"action allow" = "Prosseguir"; - -"action allowed" = "Permitido"; - -"titles header" = "Necessidade de Permissão"; - -"titles sub header" = "Pedido de permissões"; - -"titles description" = "Estas são as permissões de que o aplicativo necessita para funcionar correctamente. Por favor, ver descrição de cada permissão."; - -"titles comment" = "As permissões são necessárias para que a aplicação funcione e funcione correctamente. Não são necessárias permissões para a aplicação."; - -"permission camera name" = "Câmara"; - -"permission camera description" = "Permitir o uso da câmara"; - -"permission photoLibrary name" = "Biblioteca de fotos"; - -"permission photoLibrary description" = "Acesso para guardar fotos na sua galeria"; - -"permission microphone name" = "Microfone"; - -"permission microphone description" = "Permitir a gravação de voz da app"; - -"permission calendar name" = "Calendário"; - -"permission calendar description" = "A aplicação pode adicionar eventos ao calendário"; - -"permission contacts name" = "Contactos"; - -"permission contacts description" = "Acesso para os seus contactos e telefones"; - -"permission reminders name" = "Lembretes"; - -"permission reminders description" = "A aplicação pode criar uma nova tarefa"; - -"permission speech name" = "Discurso"; - -"permission speech description" = "Permita verificar a sua voz"; - -"permission motion name" = "Moção"; - -"permission motion description" = "Permitir o registo de movimentos e dados relacionados com o ambiente"; - -"permission media library name" = "Mediateca"; - -"permission media library description" = "Permita verificar os seus meios de comunicação"; - -"permission bluetooth name" = "Bluetooth"; - -"permission bluetooth description" = "Permitir o acesso ao bluetooth"; - -"permission notification name" = "Notificação"; - -"permission notification description" = "Obter informações importantes sem abrir a aplicação."; - -"permission location when in use name" = "Localização Quando Usar"; - -"permission location when in use description" = "Permitir o acesso à sua localização"; - -"permission location always name" = "Localização Sempre"; - -"permission location always description" = "Permitir o acesso à sua localização"; - -"permission tracking name" = "Rastreamento"; - -"permission tracking description" = "Permitir o acesso a dados relacionados com as aplicações"; - -"permission faceid name" = "FaceID"; - -"permission faceid description" = "Permitir a utilização da identidade de identificação facial"; - -"permission siri name" = "Siri"; - -"permission siri description" = "Poderá utilizar o Siri"; - -"permission health name" = "Saúde"; - -"permission health description" = "Permitir o acesso a dados de saúde"; - -"denied alert title" = "Permissão negada"; - -"denied alert description" = "Por favor, vá a Settings e permita a permissão."; - -"denied alert action" = "Definições"; - -"denied alert cancel" = "Cancelar"; - -"action denied" = "Negado"; diff --git a/Sources/PermissionsKit/Resources/Localization/ru.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/ru.lproj/Localizable.strings deleted file mode 100644 index 7023c49..0000000 --- a/Sources/PermissionsKit/Resources/Localization/ru.lproj/Localizable.strings +++ /dev/null @@ -1,89 +0,0 @@ -"action allow" = "Разрешить"; - -"action allowed" = "Готово"; - -"titles header" = "Нужны разрешения"; - -"titles sub header" = "Запрос"; - -"titles description" = "Это разрешения, необходимые приложению для правильной работы. Гляньте описание каждого разрешения."; - -"titles comment" = "Разрешения необходимы для работы и правильной работы приложения. Уведомления не обязательны."; - -"permission camera name" = "Камера"; - -"permission camera description" = "Разрешить доступ приложения к камере."; - -"permission photoLibrary name" = "Галерея"; - -"permission photoLibrary description" = "Приложение сможет сохранять фото в галерею"; - -"permission microphone name" = "Микрофон"; - -"permission microphone description" = "Приложение сможет записывать голос"; - -"permission calendar name" = "Календарь"; - -"permission calendar description" = "Доступ к событиям в календаре"; - -"permission contacts name" = "Контакты"; - -"permission contacts description" = "Доступ к контактам из телефонной книжки"; - -"permission reminders name" = "Напоминания"; - -"permission reminders description" = "Приложение сможет создавать и редактировать напоминания"; - -"permission speech name" = "Распознавание Речи"; - -"permission speech description" = "Приложение сможет анализировать вашу речь"; - -"permission motion name" = "Движение"; - -"permission motion description" = "Позволяет записывать данные о движении и окружающей среде"; - -"permission media library name" = "Медиа библиотека"; - -"permission media library description" = "Доступ к вашим медиа"; - -"permission bluetooth name" = "Bluetooth"; - -"permission bluetooth description" = "Приложение будет иметь доступ к Bluetooth"; - -"permission notification name" = "Уведомления"; - -"permission notification description" = "Получайте важную информацию, не открывая приложение."; - -"permission location when in use name" = "Локация, когда открыто приложение"; - -"permission location when in use description" = "Разрешить доступ к вашему местоположению"; - -"permission location always name" = "Локация"; - -"permission location always description" = "Разрешить доступ к вашему местоположению"; - -"permission tracking name" = "Отслеживание"; - -"permission tracking description" = "Разрешить отслеживание с помощью рекламного идентификатора"; - -"permission faceid name" = "FaceID"; - -"permission faceid description" = "Разрешите идентификацию с помощью Face ID"; - -"denied alert title" = "Разрешение заблокировано"; - -"permission siri name" = "Siri"; - -"permission siri description" = "Вы сможете пользоваться Siri"; - -"permission health name" = "Здоровье"; - -"permission health description" = "Разрешить доступ к данным о здоровье"; - -"denied alert description" = "Пожалуйста, перейдите в настройки и измените доступ к разрешению."; - -"denied alert action" = "Открыть Настройки"; - -"denied alert cancel" = "Отменить"; - -"action denied" = "Отклонено"; diff --git a/Sources/PermissionsKit/Resources/Localization/uk.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/uk.lproj/Localizable.strings deleted file mode 100644 index 5ede802..0000000 --- a/Sources/PermissionsKit/Resources/Localization/uk.lproj/Localizable.strings +++ /dev/null @@ -1,89 +0,0 @@ -"action allow" = "Дозвольте"; - -"action allowed" = "Дозволено"; - -"titles header" = "Потрібен дозвіл"; - -"titles sub header" = "Запит на дозвіл"; - -"titles description" = "Це дозволи, які вимагає програма для належної роботи. Будь ласка, див. Опис кожного дозволу."; - -"titles comment" = "Дозволи необхідні для того, щоб програма працювала та працювала правильно. Push не потрібні дозволи"; - -"permission camera name" = "Камера"; - -"permission camera description" = "Дозволити програмі використовувати камеру"; - -"permission photoLibrary name" = "Фототека"; - -"permission photoLibrary description" = "Доступ для збереження фотографій у вашій галереї"; - -"permission microphone name" = "Мікрофон"; - -"permission microphone description" = "Дозволити записувати голос із програми"; - -"permission calendar name" = "Календар"; - -"permission calendar description" = "Додаток може додавати події до календаря"; - -"permission contacts name" = "Контакти"; - -"permission contacts description" = "Доступ для ваших контактів і телефонів"; - -"permission reminders name" = "Нагадування"; - -"permission reminders description" = "Додаток може створити нове завдання"; - -"permission speech name" = "Мовлення"; - -"permission speech description" = "Дозвольте перевірити свій голос"; - -"permission motion name" = "Рух"; - -"permission motion description" = "Дозволити записувати дані про рух та навколишнє середовище"; - -"permission media library name" = "Медіатека"; - -"permission media library description" = "Дозвольте перевірити медіа"; - -"permission bluetooth name" = "Bluetooth"; - -"permission bluetooth description" = "Дозволити доступ до Bluetooth"; - -"permission notification name" = "Повідомлення"; - -"permission notification description" = "Отримуйте важливу інформацію, не відкриваючи додаток."; - -"permission location when in use name" = "Розташування під час використання"; - -"permission location when in use description" = "Дозволити доступ до вашого місцезнаходження"; - -"permission location always name" = "Розташування Завжди"; - -"permission location always description" = "Дозволити доступ до вашого місцезнаходження"; - -"permission tracking name" = "Відстеження"; - -"permission tracking description" = "Дозволити доступ до даних, пов’язаних із додатками"; - -"permission faceid name" = "FaceID"; - -"permission faceid description" = "Дозволити використання ідентифікатора обличчя Face ID"; - -"denied alert title" = "Дозвіл відмовлено"; - -"permission siri name" = "Siri"; - -"permission siri description" = "Ви зможете користуватися Siri"; - -"permission health name" = "Здоров'я"; - -"permission health description" = "Дозволити доступ до даних про стан здоров’я"; - -"denied alert description" = "Перейдіть у Налаштування та надайте дозвіл."; - -"denied alert action" = "Налаштування"; - -"denied alert cancel" = "Скасувати"; - -"action denied" = "Заперечується"; diff --git a/Sources/PermissionsKit/Resources/Localization/zh-Hant.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/zh-Hant.lproj/Localizable.strings deleted file mode 100644 index d886a0c..0000000 --- a/Sources/PermissionsKit/Resources/Localization/zh-Hant.lproj/Localizable.strings +++ /dev/null @@ -1,89 +0,0 @@ -"action allow" = "允許"; - -"action allowed" = "已允許"; - -"titles header" = "需要取用權限"; - -"titles sub header" = "要求取用權限"; - -"titles description" = "為了提供完整的服務,App 需要以下取用權限,請參考每個取用權限的說明。"; - -"titles comment" = "App 需要取用權限才能得到最完整的體驗,推播通知不是必須的取用權限。"; - -"permission camera name" = "相機"; - -"permission camera description" = "允許 App 使用相機"; - -"permission photoLibrary name" = "相簿"; - -"permission photoLibrary description" = "允許 App 儲存照片到您的相簿"; - -"permission microphone name" = "麥克風"; - -"permission microphone description" = "允許 App 錄音"; - -"permission calendar name" = "日曆"; - -"permission calendar description" = "允許 App 新增行程至您的日曆"; - -"permission contacts name" = "通訊錄"; - -"permission contacts description" = "允許 App 取用您的聯絡人和電話號碼"; - -"permission reminders name" = "提醒事項"; - -"permission reminders description" = "允許 App 新增提醒事項"; - -"permission speech name" = "語音辨識"; - -"permission speech description" = "允許 App 分析您的聲音"; - -"permission motion name" = "運動"; - -"permission motion description" = "允許紀錄運動與相關資料"; - -"permission media library name" = "媒體櫃"; - -"permission media library description" = "允許取用您的媒體櫃"; - -"permission bluetooth name" = "藍芽"; - -"permission bluetooth description" = "允許使用藍芽"; - -"permission notification name" = "推播通知"; - -"permission notification description" = "在不打開 App 的情況下,取得重要通知"; - -"permission location when in use name" = "在使用 App 期間取用位置"; - -"permission location when in use description" = "取用您的位置"; - -"permission location always name" = "總是取用位置"; - -"permission location always description" = "取用您的位置"; - -"permission tracking name" = "追蹤"; - -"permission tracking description" = "允許追蹤您在其他公司的 App 和網站上的活動"; - -"permission faceid name" = "FaceID"; - -"permission faceid description" = "允許使用 Face ID"; - -"permission siri name" = "Siri"; - -"permission siri description" = "您將能夠使用 Siri"; - -"permission health name" = "健康"; - -"permission health description" = "允許取用健康的資料"; - -"denied alert title" = "已拒絕取用"; - -"denied alert description" = "請前往至「設定」並允許取用"; - -"denied alert action" = "設定"; - -"denied alert cancel" = "取消"; - -"action denied" = "拒絕"; diff --git a/Sources/PermissionsKit/Resources/Localization/zh_Hans.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/zh_Hans.lproj/Localizable.strings deleted file mode 100644 index 9d315ab..0000000 --- a/Sources/PermissionsKit/Resources/Localization/zh_Hans.lproj/Localizable.strings +++ /dev/null @@ -1,89 +0,0 @@ -"action allow" = "允许"; - -"action allowed" = "已允许"; - -"titles header" = "需要授权"; - -"titles sub header" = "授权请求"; - -"titles description" = "为了提供更好的服务, App 需要如下权限. 请参考每个权限的说明."; - -"titles comment" = "App 需要权限才能正常工作和执行. 推送通知不是必需的权限"; - -"permission camera name" = "相机"; - -"permission camera description" = "允许 App 使用相机"; - -"permission photoLibrary name" = "照片图库"; - -"permission photoLibrary description" = "允许 App 将照片保存到您的图库"; - -"permission microphone name" = "麦克风"; - -"permission microphone description" = "允许 App 录制音频"; - -"permission calendar name" = "日历"; - -"permission calendar description" = "允许 App 添加活动至您的日历"; - -"permission contacts name" = "通讯录"; - -"permission contacts description" = "允许 App 获取您的联系人以及电话号码"; - -"permission reminders name" = "提醒事项"; - -"permission reminders description" = "允许 App 创建新的事件"; - -"permission speech name" = "语音识别"; - -"permission speech description" = "允许 App 分析您的语音"; - -"permission motion name" = "运动"; - -"permission motion description" = "允许记录运动以及环境相关信息"; - -"permission media library name" = "媒体"; - -"permission media library description" = "允许访问您的媒体"; - -"permission bluetooth name" = "蓝牙"; - -"permission bluetooth description" = "允许使用蓝牙"; - -"permission notification name" = "通知"; - -"permission notification description" = "不打开 App 情况下获取重要通知."; - -"permission location when in use name" = "使用 App 期间访问位置"; - -"permission location when in use description" = "访问您的位置"; - -"permission location always name" = "始终访问位置"; - -"permission location always description" = "访问您的位置"; - -"permission tracking name" = "跟踪"; - -"permission tracking description" = "允许访问 App 相关的数据"; - -"permission faceid name" = "FaceID"; - -"permission faceid description" = "允许使用Face ID身份"; - -"permission siri name" = "Siri"; - -"permission siri description" = "你将能够使用Siri"; - -"permission health name" = "健康"; - -"permission health description" = "允许访问健康数据"; - -"denied alert title" = "已拒绝授权"; - -"denied alert description" = "请跳转至设置并允许授权"; - -"denied alert action" = "设置"; - -"denied alert cancel" = "取消"; - -"action denied" = "拒绝"; diff --git a/Sources/PermissionsKit/Services/DelayService.swift b/Sources/PermissionsKit/Services/DelayService.swift deleted file mode 100644 index df8d151..0000000 --- a/Sources/PermissionsKit/Services/DelayService.swift +++ /dev/null @@ -1,32 +0,0 @@ -// The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import UIKit - -enum DelayService { - - public static func wait(_ delay: Double, closure: @escaping ()->()) { - let when = DispatchTime.now() + delay - DispatchQueue.main.asyncAfter(deadline: when) { - closure() - } - } -} diff --git a/Sources/PermissionsKit/Services/DrawService.swift b/Sources/PermissionsKit/Services/DrawService.swift deleted file mode 100644 index af2f452..0000000 --- a/Sources/PermissionsKit/Services/DrawService.swift +++ /dev/null @@ -1,832 +0,0 @@ -// The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import UIKit - -#if os(iOS) -enum DrawService { - - public static func drawClose(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 28, height: 28), resizing: ResizingBehavior = .aspectFit, background: UIColor = UIColor(red: 0.937, green: 0.937, blue: 0.941, alpha: 1.000), element: UIColor = UIColor(red: 0.518, green: 0.518, blue: 0.533, alpha: 1.000)) { - - let context = UIGraphicsGetCurrentContext()! - - - context.saveGState() - let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 28, height: 28), target: targetFrame) - context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) - context.scaleBy(x: resizedFrame.width / 28, y: resizedFrame.height / 28) - - - //// Rect Drawing - let rectPath = UIBezierPath() - rectPath.move(to: CGPoint(x: 14, y: 28)) - rectPath.addCurve(to: CGPoint(x: 0, y: 14), controlPoint1: CGPoint(x: 6.32, y: 28), controlPoint2: CGPoint(x: 0, y: 21.66)) - rectPath.addCurve(to: CGPoint(x: 13.99, y: 0), controlPoint1: CGPoint(x: 0, y: 6.34), controlPoint2: CGPoint(x: 6.32, y: 0)) - rectPath.addCurve(to: CGPoint(x: 28, y: 14), controlPoint1: CGPoint(x: 21.65, y: 0), controlPoint2: CGPoint(x: 28, y: 6.34)) - rectPath.addCurve(to: CGPoint(x: 14, y: 28), controlPoint1: CGPoint(x: 28, y: 21.66), controlPoint2: CGPoint(x: 21.66, y: 28)) - rectPath.close() - background.setFill() - rectPath.fill() - - - //// Icon Drawing - let iconPath = UIBezierPath() - iconPath.move(to: CGPoint(x: 8.88, y: 20.03)) - iconPath.addCurve(to: CGPoint(x: 9.55, y: 19.75), controlPoint1: CGPoint(x: 9.14, y: 20.03), controlPoint2: CGPoint(x: 9.37, y: 19.93)) - iconPath.addLine(to: CGPoint(x: 13.99, y: 15.3)) - iconPath.addLine(to: CGPoint(x: 18.44, y: 19.75)) - iconPath.addCurve(to: CGPoint(x: 19.11, y: 20.03), controlPoint1: CGPoint(x: 18.61, y: 19.92), controlPoint2: CGPoint(x: 18.84, y: 20.03)) - iconPath.addCurve(to: CGPoint(x: 20.03, y: 19.12), controlPoint1: CGPoint(x: 19.63, y: 20.03), controlPoint2: CGPoint(x: 20.03, y: 19.63)) - iconPath.addCurve(to: CGPoint(x: 19.75, y: 18.45), controlPoint1: CGPoint(x: 20.03, y: 18.86), controlPoint2: CGPoint(x: 19.93, y: 18.63)) - iconPath.addLine(to: CGPoint(x: 15.3, y: 14)) - iconPath.addLine(to: CGPoint(x: 19.75, y: 9.53)) - iconPath.addCurve(to: CGPoint(x: 20.04, y: 8.88), controlPoint1: CGPoint(x: 19.96, y: 9.34), controlPoint2: CGPoint(x: 20.04, y: 9.13)) - iconPath.addCurve(to: CGPoint(x: 19.11, y: 7.97), controlPoint1: CGPoint(x: 20.04, y: 8.37), controlPoint2: CGPoint(x: 19.63, y: 7.97)) - iconPath.addCurve(to: CGPoint(x: 18.47, y: 8.26), controlPoint1: CGPoint(x: 18.87, y: 7.97), controlPoint2: CGPoint(x: 18.66, y: 8.05)) - iconPath.addLine(to: CGPoint(x: 13.99, y: 12.72)) - iconPath.addLine(to: CGPoint(x: 9.53, y: 8.26)) - iconPath.addCurve(to: CGPoint(x: 8.88, y: 7.98), controlPoint1: CGPoint(x: 9.35, y: 8.08), controlPoint2: CGPoint(x: 9.14, y: 7.98)) - iconPath.addCurve(to: CGPoint(x: 7.96, y: 8.89), controlPoint1: CGPoint(x: 8.36, y: 7.98), controlPoint2: CGPoint(x: 7.96, y: 8.37)) - iconPath.addCurve(to: CGPoint(x: 8.24, y: 9.53), controlPoint1: CGPoint(x: 7.96, y: 9.14), controlPoint2: CGPoint(x: 8.05, y: 9.37)) - iconPath.addLine(to: CGPoint(x: 12.69, y: 14)) - iconPath.addLine(to: CGPoint(x: 8.24, y: 18.47)) - iconPath.addCurve(to: CGPoint(x: 7.96, y: 19.12), controlPoint1: CGPoint(x: 8.05, y: 18.65), controlPoint2: CGPoint(x: 7.96, y: 18.86)) - iconPath.addCurve(to: CGPoint(x: 8.88, y: 20.03), controlPoint1: CGPoint(x: 7.96, y: 19.63), controlPoint2: CGPoint(x: 8.36, y: 20.03)) - iconPath.close() - element.setFill() - iconPath.fill() - - context.restoreGState() - - } - - public static func drawCalendar(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 150, height: 150), resizing: ResizingBehavior = .aspectFit, color: UIColor = UIColor(red: 0.000, green: 0.478, blue: 1.000, alpha: 1.000)) { - - let context = UIGraphicsGetCurrentContext()! - - - context.saveGState() - let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 150, height: 150), target: targetFrame) - context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) - context.scaleBy(x: resizedFrame.width / 150, y: resizedFrame.height / 150) - - let bezierPath = UIBezierPath() - bezierPath.move(to: CGPoint(x: 41.33, y: 120.89)) - bezierPath.addLine(to: CGPoint(x: 108.03, y: 120.89)) - bezierPath.addCurve(to: CGPoint(x: 123.31, y: 105.76), controlPoint1: CGPoint(x: 118.24, y: 120.89), controlPoint2: CGPoint(x: 123.31, y: 115.81)) - bezierPath.addLine(to: CGPoint(x: 123.31, y: 46.14)) - bezierPath.addCurve(to: CGPoint(x: 108.03, y: 31), controlPoint1: CGPoint(x: 123.31, y: 36.08), controlPoint2: CGPoint(x: 118.24, y: 31)) - bezierPath.addLine(to: CGPoint(x: 41.33, y: 31)) - bezierPath.addCurve(to: CGPoint(x: 26, y: 46.14), controlPoint1: CGPoint(x: 31.13, y: 31), controlPoint2: CGPoint(x: 26, y: 36.03)) - bezierPath.addLine(to: CGPoint(x: 26, y: 105.76)) - bezierPath.addCurve(to: CGPoint(x: 41.33, y: 120.89), controlPoint1: CGPoint(x: 26, y: 115.86), controlPoint2: CGPoint(x: 31.13, y: 120.89)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 40.6, y: 113.03)) - bezierPath.addCurve(to: CGPoint(x: 33.86, y: 106.2), controlPoint1: CGPoint(x: 36.25, y: 113.03), controlPoint2: CGPoint(x: 33.86, y: 110.74)) - bezierPath.addLine(to: CGPoint(x: 33.86, y: 60.15)) - bezierPath.addCurve(to: CGPoint(x: 40.6, y: 53.31), controlPoint1: CGPoint(x: 33.86, y: 55.66), controlPoint2: CGPoint(x: 36.25, y: 53.31)) - bezierPath.addLine(to: CGPoint(x: 108.67, y: 53.31)) - bezierPath.addCurve(to: CGPoint(x: 115.45, y: 60.15), controlPoint1: CGPoint(x: 113.01, y: 53.31), controlPoint2: CGPoint(x: 115.45, y: 55.66)) - bezierPath.addLine(to: CGPoint(x: 115.45, y: 106.2)) - bezierPath.addCurve(to: CGPoint(x: 108.67, y: 113.03), controlPoint1: CGPoint(x: 115.45, y: 110.74), controlPoint2: CGPoint(x: 113.01, y: 113.03)) - bezierPath.addLine(to: CGPoint(x: 40.6, y: 113.03)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 65.11, y: 70.84)) - bezierPath.addLine(to: CGPoint(x: 67.99, y: 70.84)) - bezierPath.addCurve(to: CGPoint(x: 70.29, y: 68.65), controlPoint1: CGPoint(x: 69.7, y: 70.84), controlPoint2: CGPoint(x: 70.29, y: 70.36)) - bezierPath.addLine(to: CGPoint(x: 70.29, y: 65.77)) - bezierPath.addCurve(to: CGPoint(x: 67.99, y: 63.52), controlPoint1: CGPoint(x: 70.29, y: 64.06), controlPoint2: CGPoint(x: 69.7, y: 63.52)) - bezierPath.addLine(to: CGPoint(x: 65.11, y: 63.52)) - bezierPath.addCurve(to: CGPoint(x: 62.82, y: 65.77), controlPoint1: CGPoint(x: 63.4, y: 63.52), controlPoint2: CGPoint(x: 62.82, y: 64.06)) - bezierPath.addLine(to: CGPoint(x: 62.82, y: 68.65)) - bezierPath.addCurve(to: CGPoint(x: 65.11, y: 70.84), controlPoint1: CGPoint(x: 62.82, y: 70.36), controlPoint2: CGPoint(x: 63.4, y: 70.84)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 81.37, y: 70.84)) - bezierPath.addLine(to: CGPoint(x: 84.2, y: 70.84)) - bezierPath.addCurve(to: CGPoint(x: 86.5, y: 68.65), controlPoint1: CGPoint(x: 85.91, y: 70.84), controlPoint2: CGPoint(x: 86.5, y: 70.36)) - bezierPath.addLine(to: CGPoint(x: 86.5, y: 65.77)) - bezierPath.addCurve(to: CGPoint(x: 84.2, y: 63.52), controlPoint1: CGPoint(x: 86.5, y: 64.06), controlPoint2: CGPoint(x: 85.91, y: 63.52)) - bezierPath.addLine(to: CGPoint(x: 81.37, y: 63.52)) - bezierPath.addCurve(to: CGPoint(x: 79.08, y: 65.77), controlPoint1: CGPoint(x: 79.61, y: 63.52), controlPoint2: CGPoint(x: 79.08, y: 64.06)) - bezierPath.addLine(to: CGPoint(x: 79.08, y: 68.65)) - bezierPath.addCurve(to: CGPoint(x: 81.37, y: 70.84), controlPoint1: CGPoint(x: 79.08, y: 70.36), controlPoint2: CGPoint(x: 79.61, y: 70.84)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 97.58, y: 70.84)) - bezierPath.addLine(to: CGPoint(x: 100.46, y: 70.84)) - bezierPath.addCurve(to: CGPoint(x: 102.71, y: 68.65), controlPoint1: CGPoint(x: 102.17, y: 70.84), controlPoint2: CGPoint(x: 102.71, y: 70.36)) - bezierPath.addLine(to: CGPoint(x: 102.71, y: 65.77)) - bezierPath.addCurve(to: CGPoint(x: 100.46, y: 63.52), controlPoint1: CGPoint(x: 102.71, y: 64.06), controlPoint2: CGPoint(x: 102.17, y: 63.52)) - bezierPath.addLine(to: CGPoint(x: 97.58, y: 63.52)) - bezierPath.addCurve(to: CGPoint(x: 95.29, y: 65.77), controlPoint1: CGPoint(x: 95.87, y: 63.52), controlPoint2: CGPoint(x: 95.29, y: 64.06)) - bezierPath.addLine(to: CGPoint(x: 95.29, y: 68.65)) - bezierPath.addCurve(to: CGPoint(x: 97.58, y: 70.84), controlPoint1: CGPoint(x: 95.29, y: 70.36), controlPoint2: CGPoint(x: 95.87, y: 70.84)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 48.9, y: 86.81)) - bezierPath.addLine(to: CGPoint(x: 51.78, y: 86.81)) - bezierPath.addCurve(to: CGPoint(x: 54.03, y: 84.61), controlPoint1: CGPoint(x: 53.49, y: 86.81), controlPoint2: CGPoint(x: 54.03, y: 86.32)) - bezierPath.addLine(to: CGPoint(x: 54.03, y: 81.73)) - bezierPath.addCurve(to: CGPoint(x: 51.78, y: 79.54), controlPoint1: CGPoint(x: 54.03, y: 80.02), controlPoint2: CGPoint(x: 53.49, y: 79.54)) - bezierPath.addLine(to: CGPoint(x: 48.9, y: 79.54)) - bezierPath.addCurve(to: CGPoint(x: 46.61, y: 81.73), controlPoint1: CGPoint(x: 47.19, y: 79.54), controlPoint2: CGPoint(x: 46.61, y: 80.02)) - bezierPath.addLine(to: CGPoint(x: 46.61, y: 84.61)) - bezierPath.addCurve(to: CGPoint(x: 48.9, y: 86.81), controlPoint1: CGPoint(x: 46.61, y: 86.32), controlPoint2: CGPoint(x: 47.19, y: 86.81)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 65.11, y: 86.81)) - bezierPath.addLine(to: CGPoint(x: 67.99, y: 86.81)) - bezierPath.addCurve(to: CGPoint(x: 70.29, y: 84.61), controlPoint1: CGPoint(x: 69.7, y: 86.81), controlPoint2: CGPoint(x: 70.29, y: 86.32)) - bezierPath.addLine(to: CGPoint(x: 70.29, y: 81.73)) - bezierPath.addCurve(to: CGPoint(x: 67.99, y: 79.54), controlPoint1: CGPoint(x: 70.29, y: 80.02), controlPoint2: CGPoint(x: 69.7, y: 79.54)) - bezierPath.addLine(to: CGPoint(x: 65.11, y: 79.54)) - bezierPath.addCurve(to: CGPoint(x: 62.82, y: 81.73), controlPoint1: CGPoint(x: 63.4, y: 79.54), controlPoint2: CGPoint(x: 62.82, y: 80.02)) - bezierPath.addLine(to: CGPoint(x: 62.82, y: 84.61)) - bezierPath.addCurve(to: CGPoint(x: 65.11, y: 86.81), controlPoint1: CGPoint(x: 62.82, y: 86.32), controlPoint2: CGPoint(x: 63.4, y: 86.81)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 81.37, y: 86.81)) - bezierPath.addLine(to: CGPoint(x: 84.2, y: 86.81)) - bezierPath.addCurve(to: CGPoint(x: 86.5, y: 84.61), controlPoint1: CGPoint(x: 85.91, y: 86.81), controlPoint2: CGPoint(x: 86.5, y: 86.32)) - bezierPath.addLine(to: CGPoint(x: 86.5, y: 81.73)) - bezierPath.addCurve(to: CGPoint(x: 84.2, y: 79.54), controlPoint1: CGPoint(x: 86.5, y: 80.02), controlPoint2: CGPoint(x: 85.91, y: 79.54)) - bezierPath.addLine(to: CGPoint(x: 81.37, y: 79.54)) - bezierPath.addCurve(to: CGPoint(x: 79.08, y: 81.73), controlPoint1: CGPoint(x: 79.61, y: 79.54), controlPoint2: CGPoint(x: 79.08, y: 80.02)) - bezierPath.addLine(to: CGPoint(x: 79.08, y: 84.61)) - bezierPath.addCurve(to: CGPoint(x: 81.37, y: 86.81), controlPoint1: CGPoint(x: 79.08, y: 86.32), controlPoint2: CGPoint(x: 79.61, y: 86.81)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 97.58, y: 86.81)) - bezierPath.addLine(to: CGPoint(x: 100.46, y: 86.81)) - bezierPath.addCurve(to: CGPoint(x: 102.71, y: 84.61), controlPoint1: CGPoint(x: 102.17, y: 86.81), controlPoint2: CGPoint(x: 102.71, y: 86.32)) - bezierPath.addLine(to: CGPoint(x: 102.71, y: 81.73)) - bezierPath.addCurve(to: CGPoint(x: 100.46, y: 79.54), controlPoint1: CGPoint(x: 102.71, y: 80.02), controlPoint2: CGPoint(x: 102.17, y: 79.54)) - bezierPath.addLine(to: CGPoint(x: 97.58, y: 79.54)) - bezierPath.addCurve(to: CGPoint(x: 95.29, y: 81.73), controlPoint1: CGPoint(x: 95.87, y: 79.54), controlPoint2: CGPoint(x: 95.29, y: 80.02)) - bezierPath.addLine(to: CGPoint(x: 95.29, y: 84.61)) - bezierPath.addCurve(to: CGPoint(x: 97.58, y: 86.81), controlPoint1: CGPoint(x: 95.29, y: 86.32), controlPoint2: CGPoint(x: 95.87, y: 86.81)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 48.9, y: 102.83)) - bezierPath.addLine(to: CGPoint(x: 51.78, y: 102.83)) - bezierPath.addCurve(to: CGPoint(x: 54.03, y: 100.58), controlPoint1: CGPoint(x: 53.49, y: 102.83), controlPoint2: CGPoint(x: 54.03, y: 102.29)) - bezierPath.addLine(to: CGPoint(x: 54.03, y: 97.7)) - bezierPath.addCurve(to: CGPoint(x: 51.96, y: 95.5), controlPoint1: CGPoint(x: 54.03, y: 96.05), controlPoint2: CGPoint(x: 53.53, y: 95.54)) - bezierPath.addLine(to: CGPoint(x: 48.9, y: 95.5)) - bezierPath.addCurve(to: CGPoint(x: 46.61, y: 97.7), controlPoint1: CGPoint(x: 47.19, y: 95.5), controlPoint2: CGPoint(x: 46.61, y: 95.99)) - bezierPath.addLine(to: CGPoint(x: 46.61, y: 100.58)) - bezierPath.addCurve(to: CGPoint(x: 48.9, y: 102.83), controlPoint1: CGPoint(x: 46.61, y: 102.29), controlPoint2: CGPoint(x: 47.19, y: 102.83)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 65.11, y: 102.83)) - bezierPath.addLine(to: CGPoint(x: 67.99, y: 102.83)) - bezierPath.addCurve(to: CGPoint(x: 70.29, y: 100.58), controlPoint1: CGPoint(x: 69.7, y: 102.83), controlPoint2: CGPoint(x: 70.29, y: 102.29)) - bezierPath.addLine(to: CGPoint(x: 70.29, y: 97.7)) - bezierPath.addCurve(to: CGPoint(x: 68.17, y: 95.5), controlPoint1: CGPoint(x: 70.29, y: 96.05), controlPoint2: CGPoint(x: 69.74, y: 95.54)) - bezierPath.addLine(to: CGPoint(x: 65.11, y: 95.5)) - bezierPath.addCurve(to: CGPoint(x: 62.82, y: 97.7), controlPoint1: CGPoint(x: 63.4, y: 95.5), controlPoint2: CGPoint(x: 62.82, y: 95.99)) - bezierPath.addLine(to: CGPoint(x: 62.82, y: 100.58)) - bezierPath.addCurve(to: CGPoint(x: 65.11, y: 102.83), controlPoint1: CGPoint(x: 62.82, y: 102.29), controlPoint2: CGPoint(x: 63.4, y: 102.83)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 81.37, y: 102.83)) - bezierPath.addCurve(to: CGPoint(x: 79.08, y: 100.58), controlPoint1: CGPoint(x: 79.61, y: 102.83), controlPoint2: CGPoint(x: 79.08, y: 102.29)) - bezierPath.addLine(to: CGPoint(x: 79.08, y: 97.7)) - bezierPath.addCurve(to: CGPoint(x: 81.19, y: 95.5), controlPoint1: CGPoint(x: 79.08, y: 96.05), controlPoint2: CGPoint(x: 79.58, y: 95.54)) - bezierPath.addLine(to: CGPoint(x: 84.2, y: 95.5)) - bezierPath.addCurve(to: CGPoint(x: 86.5, y: 97.7), controlPoint1: CGPoint(x: 85.91, y: 95.5), controlPoint2: CGPoint(x: 86.5, y: 95.99)) - bezierPath.addLine(to: CGPoint(x: 86.5, y: 100.58)) - bezierPath.addCurve(to: CGPoint(x: 84.2, y: 102.83), controlPoint1: CGPoint(x: 86.5, y: 102.29), controlPoint2: CGPoint(x: 85.91, y: 102.83)) - bezierPath.addLine(to: CGPoint(x: 81.37, y: 102.83)) - bezierPath.close() - color.setFill() - bezierPath.fill() - - context.restoreGState() - - } - - public static func drawCamera(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 150, height: 150), resizing: ResizingBehavior = .aspectFit, color: UIColor = UIColor(red: 0.000, green: 0.478, blue: 1.000, alpha: 1.000)) { - - let context = UIGraphicsGetCurrentContext()! - - - context.saveGState() - let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 150, height: 150), target: targetFrame) - context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) - context.scaleBy(x: resizedFrame.width / 150, y: resizedFrame.height / 150) - - let bezierPath = UIBezierPath() - bezierPath.move(to: CGPoint(x: 32.33, y: 122.12)) - bezierPath.addLine(to: CGPoint(x: 116.41, y: 122.12)) - bezierPath.addCurve(to: CGPoint(x: 131.75, y: 106.98), controlPoint1: CGPoint(x: 126.62, y: 122.12), controlPoint2: CGPoint(x: 131.75, y: 117.04)) - bezierPath.addLine(to: CGPoint(x: 131.75, y: 55.86)) - bezierPath.addCurve(to: CGPoint(x: 116.41, y: 40.77), controlPoint1: CGPoint(x: 131.75, y: 45.8), controlPoint2: CGPoint(x: 126.62, y: 40.77)) - bezierPath.addLine(to: CGPoint(x: 105.04, y: 40.77)) - bezierPath.addCurve(to: CGPoint(x: 97.86, y: 37.54), controlPoint1: CGPoint(x: 101.23, y: 40.77), controlPoint2: CGPoint(x: 100.01, y: 39.99)) - bezierPath.addLine(to: CGPoint(x: 93.9, y: 33.15)) - bezierPath.addCurve(to: CGPoint(x: 83.94, y: 29), controlPoint1: CGPoint(x: 91.46, y: 30.46), controlPoint2: CGPoint(x: 88.97, y: 29)) - bezierPath.addLine(to: CGPoint(x: 64.46, y: 29)) - bezierPath.addCurve(to: CGPoint(x: 54.5, y: 33.15), controlPoint1: CGPoint(x: 59.43, y: 29), controlPoint2: CGPoint(x: 56.94, y: 30.46)) - bezierPath.addLine(to: CGPoint(x: 50.59, y: 37.54)) - bezierPath.addCurve(to: CGPoint(x: 43.42, y: 40.77), controlPoint1: CGPoint(x: 48.45, y: 39.94), controlPoint2: CGPoint(x: 47.22, y: 40.77)) - bezierPath.addLine(to: CGPoint(x: 32.33, y: 40.77)) - bezierPath.addCurve(to: CGPoint(x: 17, y: 55.86), controlPoint1: CGPoint(x: 22.13, y: 40.77), controlPoint2: CGPoint(x: 17, y: 45.8)) - bezierPath.addLine(to: CGPoint(x: 17, y: 106.98)) - bezierPath.addCurve(to: CGPoint(x: 32.33, y: 122.12), controlPoint1: CGPoint(x: 17, y: 117.04), controlPoint2: CGPoint(x: 22.13, y: 122.12)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 74.37, y: 106.49)) - bezierPath.addCurve(to: CGPoint(x: 47.76, y: 79.78), controlPoint1: CGPoint(x: 59.63, y: 106.49), controlPoint2: CGPoint(x: 47.76, y: 94.62)) - bezierPath.addCurve(to: CGPoint(x: 74.37, y: 53.07), controlPoint1: CGPoint(x: 47.76, y: 64.94), controlPoint2: CGPoint(x: 59.63, y: 53.07)) - bezierPath.addCurve(to: CGPoint(x: 101.03, y: 79.78), controlPoint1: CGPoint(x: 89.17, y: 53.07), controlPoint2: CGPoint(x: 101.03, y: 64.94)) - bezierPath.addCurve(to: CGPoint(x: 74.37, y: 106.49), controlPoint1: CGPoint(x: 101.03, y: 94.62), controlPoint2: CGPoint(x: 89.17, y: 106.49)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 109.48, y: 67.87)) - bezierPath.addCurve(to: CGPoint(x: 103.43, y: 61.86), controlPoint1: CGPoint(x: 106.16, y: 67.87), controlPoint2: CGPoint(x: 103.43, y: 65.18)) - bezierPath.addCurve(to: CGPoint(x: 109.48, y: 55.81), controlPoint1: CGPoint(x: 103.43, y: 58.49), controlPoint2: CGPoint(x: 106.16, y: 55.81)) - bezierPath.addCurve(to: CGPoint(x: 115.54, y: 61.86), controlPoint1: CGPoint(x: 112.8, y: 55.81), controlPoint2: CGPoint(x: 115.54, y: 58.49)) - bezierPath.addCurve(to: CGPoint(x: 109.48, y: 67.87), controlPoint1: CGPoint(x: 115.54, y: 65.18), controlPoint2: CGPoint(x: 112.8, y: 67.87)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 74.37, y: 99.07)) - bezierPath.addCurve(to: CGPoint(x: 55.13, y: 79.78), controlPoint1: CGPoint(x: 63.78, y: 99.07), controlPoint2: CGPoint(x: 55.13, y: 90.47)) - bezierPath.addCurve(to: CGPoint(x: 74.37, y: 60.49), controlPoint1: CGPoint(x: 55.13, y: 69.09), controlPoint2: CGPoint(x: 63.73, y: 60.49)) - bezierPath.addCurve(to: CGPoint(x: 93.66, y: 79.78), controlPoint1: CGPoint(x: 85.02, y: 60.49), controlPoint2: CGPoint(x: 93.66, y: 69.09)) - bezierPath.addCurve(to: CGPoint(x: 74.37, y: 99.07), controlPoint1: CGPoint(x: 93.66, y: 90.47), controlPoint2: CGPoint(x: 85.02, y: 99.07)) - bezierPath.close() - color.setFill() - bezierPath.fill() - - context.restoreGState() - - } - - public static func drawContacts(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 150, height: 150), resizing: ResizingBehavior = .aspectFit, color: UIColor = UIColor(red: 0.000, green: 0.478, blue: 1.000, alpha: 1.000)) { - - let context = UIGraphicsGetCurrentContext()! - - - context.saveGState() - let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 150, height: 150), target: targetFrame) - context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) - context.scaleBy(x: resizedFrame.width / 150, y: resizedFrame.height / 150) - - let bezierPath = UIBezierPath() - bezierPath.move(to: CGPoint(x: 52.15, y: 110.78)) - bezierPath.addCurve(to: CGPoint(x: 68.12, y: 115.52), controlPoint1: CGPoint(x: 60.3, y: 110.78), controlPoint2: CGPoint(x: 65.72, y: 113.81)) - bezierPath.addLine(to: CGPoint(x: 69.24, y: 116.17)) - bezierPath.addCurve(to: CGPoint(x: 72.02, y: 117.52), controlPoint1: CGPoint(x: 70.31, y: 116.77), controlPoint2: CGPoint(x: 71.65, y: 117.49)) - bezierPath.addLine(to: CGPoint(x: 72.02, y: 43.69)) - bezierPath.addCurve(to: CGPoint(x: 49.8, y: 33), controlPoint1: CGPoint(x: 68.85, y: 37.79), controlPoint2: CGPoint(x: 59.47, y: 33)) - bezierPath.addCurve(to: CGPoint(x: 25, y: 44.77), controlPoint1: CGPoint(x: 37.65, y: 33), controlPoint2: CGPoint(x: 27.29, y: 40.03)) - bezierPath.addLine(to: CGPoint(x: 25, y: 113.71)) - bezierPath.addCurve(to: CGPoint(x: 29.2, y: 118.16), controlPoint1: CGPoint(x: 25, y: 116.94), controlPoint2: CGPoint(x: 26.86, y: 118.16)) - bezierPath.addCurve(to: CGPoint(x: 33.45, y: 116.54), controlPoint1: CGPoint(x: 31.01, y: 118.16), controlPoint2: CGPoint(x: 32.28, y: 117.52)) - bezierPath.addCurve(to: CGPoint(x: 52.15, y: 110.78), controlPoint1: CGPoint(x: 36.33, y: 113.96), controlPoint2: CGPoint(x: 43.12, y: 110.78)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 97.71, y: 110.78)) - bezierPath.addCurve(to: CGPoint(x: 81.79, y: 115.52), controlPoint1: CGPoint(x: 89.6, y: 110.78), controlPoint2: CGPoint(x: 84.18, y: 113.81)) - bezierPath.addLine(to: CGPoint(x: 81.02, y: 115.98)) - bezierPath.addCurve(to: CGPoint(x: 77.88, y: 117.62), controlPoint1: CGPoint(x: 79.92, y: 116.65), controlPoint2: CGPoint(x: 78.3, y: 117.58)) - bezierPath.addLine(to: CGPoint(x: 77.88, y: 43.69)) - bezierPath.addCurve(to: CGPoint(x: 100.05, y: 33), controlPoint1: CGPoint(x: 81.01, y: 37.79), controlPoint2: CGPoint(x: 90.38, y: 33)) - bezierPath.addCurve(to: CGPoint(x: 124.85, y: 44.77), controlPoint1: CGPoint(x: 112.21, y: 33), controlPoint2: CGPoint(x: 122.56, y: 40.03)) - bezierPath.addLine(to: CGPoint(x: 124.85, y: 113.71)) - bezierPath.addCurve(to: CGPoint(x: 120.61, y: 118.16), controlPoint1: CGPoint(x: 124.85, y: 116.94), controlPoint2: CGPoint(x: 122.95, y: 118.16)) - bezierPath.addCurve(to: CGPoint(x: 116.46, y: 116.54), controlPoint1: CGPoint(x: 118.8, y: 118.16), controlPoint2: CGPoint(x: 117.58, y: 117.47)) - bezierPath.addCurve(to: CGPoint(x: 97.71, y: 110.78), controlPoint1: CGPoint(x: 113.48, y: 113.96), controlPoint2: CGPoint(x: 106.79, y: 110.78)) - bezierPath.close() - color.setFill() - bezierPath.fill() - - context.restoreGState() - - } - - public static func drawLocations(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 150, height: 150), resizing: ResizingBehavior = .aspectFit, color: UIColor = UIColor(red: 0.000, green: 0.478, blue: 1.000, alpha: 1.000)) { - - let context = UIGraphicsGetCurrentContext()! - - - context.saveGState() - let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 150, height: 150), target: targetFrame) - context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) - context.scaleBy(x: resizedFrame.width / 150, y: resizedFrame.height / 150) - - let bezierPath = UIBezierPath() - bezierPath.move(to: CGPoint(x: 33.4, y: 78.1)) - bezierPath.addCurve(to: CGPoint(x: 25, y: 72.19), controlPoint1: CGPoint(x: 28.61, y: 78.1), controlPoint2: CGPoint(x: 25, y: 75.95)) - bezierPath.addCurve(to: CGPoint(x: 32.32, y: 64.67), controlPoint1: CGPoint(x: 25, y: 68.43), controlPoint2: CGPoint(x: 28.61, y: 66.38)) - bezierPath.addLine(to: CGPoint(x: 112.89, y: 27.32)) - bezierPath.addCurve(to: CGPoint(x: 117.97, y: 26), controlPoint1: CGPoint(x: 114.79, y: 26.39), controlPoint2: CGPoint(x: 116.5, y: 26)) - bezierPath.addCurve(to: CGPoint(x: 123.63, y: 31.66), controlPoint1: CGPoint(x: 121.24, y: 26), controlPoint2: CGPoint(x: 123.63, y: 28.44)) - bezierPath.addCurve(to: CGPoint(x: 122.27, y: 36.69), controlPoint1: CGPoint(x: 123.63, y: 33.08), controlPoint2: CGPoint(x: 123.19, y: 34.79)) - bezierPath.addLine(to: CGPoint(x: 84.49, y: 118.06)) - bezierPath.addCurve(to: CGPoint(x: 77.39, y: 124.58), controlPoint1: CGPoint(x: 82.82, y: 121.58), controlPoint2: CGPoint(x: 80.84, y: 124.58)) - bezierPath.addCurve(to: CGPoint(x: 71.49, y: 116.41), controlPoint1: CGPoint(x: 73.61, y: 124.58), controlPoint2: CGPoint(x: 71.57, y: 120.93)) - bezierPath.addLine(to: CGPoint(x: 71.39, y: 79.27)) - bezierPath.addCurve(to: CGPoint(x: 70.36, y: 78.25), controlPoint1: CGPoint(x: 71.39, y: 78.54), controlPoint2: CGPoint(x: 71.04, y: 78.25)) - bezierPath.addLine(to: CGPoint(x: 33.4, y: 78.1)) - bezierPath.close() - color.setFill() - bezierPath.fill() - - context.restoreGState() - - } - - public static func drawMedia(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 150, height: 150), resizing: ResizingBehavior = .aspectFit, color: UIColor = UIColor(red: 0.000, green: 0.478, blue: 1.000, alpha: 1.000)) { - - let context = UIGraphicsGetCurrentContext()! - - - context.saveGState() - let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 150, height: 150), target: targetFrame) - context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) - context.scaleBy(x: resizedFrame.width / 150, y: resizedFrame.height / 150) - - let bezierPath = UIBezierPath() - bezierPath.move(to: CGPoint(x: 22.55, y: 107.05)) - bezierPath.addLine(to: CGPoint(x: 126.31, y: 107.05)) - bezierPath.addCurve(to: CGPoint(x: 138.86, y: 94.51), controlPoint1: CGPoint(x: 134.66, y: 107.05), controlPoint2: CGPoint(x: 138.86, y: 103.05)) - bezierPath.addLine(to: CGPoint(x: 138.86, y: 38.55)) - bezierPath.addCurve(to: CGPoint(x: 126.31, y: 26), controlPoint1: CGPoint(x: 138.86, y: 30), controlPoint2: CGPoint(x: 134.66, y: 26)) - bezierPath.addLine(to: CGPoint(x: 22.55, y: 26)) - bezierPath.addCurve(to: CGPoint(x: 10, y: 38.55), controlPoint1: CGPoint(x: 14.2, y: 26), controlPoint2: CGPoint(x: 10, y: 30)) - bezierPath.addLine(to: CGPoint(x: 10, y: 94.51)) - bezierPath.addCurve(to: CGPoint(x: 22.55, y: 107.05), controlPoint1: CGPoint(x: 10, y: 103.05), controlPoint2: CGPoint(x: 14.2, y: 107.05)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 89, y: 55.69)) - bezierPath.addLine(to: CGPoint(x: 76.99, y: 58.57)) - bezierPath.addCurve(to: CGPoint(x: 75.43, y: 61.25), controlPoint1: CGPoint(x: 75.82, y: 58.86), controlPoint2: CGPoint(x: 75.43, y: 59.35)) - bezierPath.addLine(to: CGPoint(x: 75.43, y: 78.78)) - bezierPath.addCurve(to: CGPoint(x: 63.12, y: 91.43), controlPoint1: CGPoint(x: 75.43, y: 86.21), controlPoint2: CGPoint(x: 70.45, y: 91.43)) - bezierPath.addCurve(to: CGPoint(x: 54.68, y: 83.96), controlPoint1: CGPoint(x: 57.95, y: 91.43), controlPoint2: CGPoint(x: 54.68, y: 88.3)) - bezierPath.addCurve(to: CGPoint(x: 63.22, y: 74.93), controlPoint1: CGPoint(x: 54.68, y: 78.93), controlPoint2: CGPoint(x: 58.58, y: 76.15)) - bezierPath.addLine(to: CGPoint(x: 67.96, y: 73.71)) - bezierPath.addLine(to: CGPoint(x: 68.39, y: 73.59)) - bezierPath.addCurve(to: CGPoint(x: 70.74, y: 70.29), controlPoint1: CGPoint(x: 70.57, y: 72.96), controlPoint2: CGPoint(x: 70.74, y: 72.45)) - bezierPath.addLine(to: CGPoint(x: 70.74, y: 47.24)) - bezierPath.addCurve(to: CGPoint(x: 73.61, y: 43.14), controlPoint1: CGPoint(x: 70.74, y: 44.3), controlPoint2: CGPoint(x: 71.25, y: 43.75)) - bezierPath.addLine(to: CGPoint(x: 88.81, y: 39.33)) - bezierPath.addCurve(to: CGPoint(x: 92.22, y: 41.31), controlPoint1: CGPoint(x: 91.46, y: 38.67), controlPoint2: CGPoint(x: 92.19, y: 39.48)) - bezierPath.addLine(to: CGPoint(x: 92.23, y: 51.54)) - bezierPath.addCurve(to: CGPoint(x: 89, y: 55.69), controlPoint1: CGPoint(x: 92.23, y: 54.52), controlPoint2: CGPoint(x: 91.49, y: 55.05)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 109.9, y: 120.63)) - bezierPath.addCurve(to: CGPoint(x: 105.41, y: 125.22), controlPoint1: CGPoint(x: 109.9, y: 123.17), controlPoint2: CGPoint(x: 107.9, y: 125.22)) - bezierPath.addLine(to: CGPoint(x: 43.35, y: 125.22)) - bezierPath.addCurve(to: CGPoint(x: 38.81, y: 120.63), controlPoint1: CGPoint(x: 40.86, y: 125.22), controlPoint2: CGPoint(x: 38.81, y: 123.17)) - bezierPath.addCurve(to: CGPoint(x: 43.35, y: 116.04), controlPoint1: CGPoint(x: 38.81, y: 118.09), controlPoint2: CGPoint(x: 40.86, y: 116.04)) - bezierPath.addLine(to: CGPoint(x: 105.41, y: 116.04)) - bezierPath.addCurve(to: CGPoint(x: 109.9, y: 120.63), controlPoint1: CGPoint(x: 107.9, y: 116.04), controlPoint2: CGPoint(x: 109.9, y: 118.09)) - bezierPath.close() - color.setFill() - bezierPath.fill() - - context.restoreGState() - - } - - public static func drawMicrophone(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 150, height: 150), resizing: ResizingBehavior = .aspectFit, color: UIColor = UIColor(red: 0.000, green: 0.478, blue: 1.000, alpha: 1.000)) { - - let context = UIGraphicsGetCurrentContext()! - - - context.saveGState() - let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 150, height: 150), target: targetFrame) - context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) - context.scaleBy(x: resizedFrame.width / 150, y: resizedFrame.height / 150) - - let bezierPath = UIBezierPath() - bezierPath.move(to: CGPoint(x: 89.37, y: 32.61)) - bezierPath.addLine(to: CGPoint(x: 116.27, y: 59.51)) - bezierPath.addCurve(to: CGPoint(x: 116.96, y: 31.92), controlPoint1: CGPoint(x: 124.87, y: 50.97), controlPoint2: CGPoint(x: 125.21, y: 40.13)) - bezierPath.addCurve(to: CGPoint(x: 89.37, y: 32.61), controlPoint1: CGPoint(x: 108.75, y: 23.82), controlPoint2: CGPoint(x: 97.96, y: 24.01)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 84.49, y: 37.54)) - bezierPath.addCurve(to: CGPoint(x: 77.89, y: 54.04), controlPoint1: CGPoint(x: 79.31, y: 42.62), controlPoint2: CGPoint(x: 77.16, y: 48.43)) - bezierPath.addLine(to: CGPoint(x: 32.53, y: 102.92)) - bezierPath.addCurve(to: CGPoint(x: 32.68, y: 110), controlPoint1: CGPoint(x: 30.68, y: 104.92), controlPoint2: CGPoint(x: 30.38, y: 107.71)) - bezierPath.addLine(to: CGPoint(x: 26.43, y: 118.06)) - bezierPath.addCurve(to: CGPoint(x: 26.67, y: 120.84), controlPoint1: CGPoint(x: 25.84, y: 118.84), controlPoint2: CGPoint(x: 25.79, y: 119.96)) - bezierPath.addLine(to: CGPoint(x: 28.09, y: 122.31)) - bezierPath.addCurve(to: CGPoint(x: 30.92, y: 122.5), controlPoint1: CGPoint(x: 28.92, y: 123.14), controlPoint2: CGPoint(x: 30.04, y: 123.18)) - bezierPath.addLine(to: CGPoint(x: 38.98, y: 116.2)) - bezierPath.addCurve(to: CGPoint(x: 45.8, y: 116.5), controlPoint1: CGPoint(x: 41.12, y: 118.43), controlPoint2: CGPoint(x: 43.86, y: 118.22)) - bezierPath.addLine(to: CGPoint(x: 71.3, y: 92.91)) - bezierPath.addLine(to: CGPoint(x: 71.3, y: 120.79)) - bezierPath.addCurve(to: CGPoint(x: 75.75, y: 125.24), controlPoint1: CGPoint(x: 71.3, y: 123.28), controlPoint2: CGPoint(x: 73.26, y: 125.24)) - bezierPath.addCurve(to: CGPoint(x: 80.19, y: 120.79), controlPoint1: CGPoint(x: 78.24, y: 125.24), controlPoint2: CGPoint(x: 80.19, y: 123.28)) - bezierPath.addLine(to: CGPoint(x: 80.19, y: 91.93)) - bezierPath.addLine(to: CGPoint(x: 79.85, y: 84.95)) - bezierPath.addLine(to: CGPoint(x: 94.74, y: 71.13)) - bezierPath.addCurve(to: CGPoint(x: 111.34, y: 64.44), controlPoint1: CGPoint(x: 100.36, y: 71.87), controlPoint2: CGPoint(x: 106.26, y: 69.57)) - bezierPath.addLine(to: CGPoint(x: 84.49, y: 37.54)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 37.56, y: 106.92)) - bezierPath.addLine(to: CGPoint(x: 80.58, y: 61.32)) - bezierPath.addCurve(to: CGPoint(x: 83.66, y: 65.27), controlPoint1: CGPoint(x: 81.41, y: 62.69), controlPoint2: CGPoint(x: 82.44, y: 64)) - bezierPath.addCurve(to: CGPoint(x: 87.46, y: 68.45), controlPoint1: CGPoint(x: 84.88, y: 66.5), controlPoint2: CGPoint(x: 86.15, y: 67.57)) - bezierPath.addLine(to: CGPoint(x: 42.05, y: 111.42)) - bezierPath.addLine(to: CGPoint(x: 37.56, y: 106.92)) - bezierPath.close() - color.setFill() - bezierPath.fill() - - context.restoreGState() - - } - - public static func drawMotion(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 150, height: 150), resizing: ResizingBehavior = .aspectFit, color: UIColor = UIColor(red: 0.000, green: 0.478, blue: 1.000, alpha: 1.000)) { - - let context = UIGraphicsGetCurrentContext()! - - - context.saveGState() - let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 150, height: 150), target: targetFrame) - context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) - context.scaleBy(x: resizedFrame.width / 150, y: resizedFrame.height / 150) - - let bezierPath = UIBezierPath() - bezierPath.move(to: CGPoint(x: 78.12, y: 119.17)) - bezierPath.addCurve(to: CGPoint(x: 89.54, y: 117.73), controlPoint1: CGPoint(x: 81.16, y: 119.17), controlPoint2: CGPoint(x: 83.85, y: 117.73)) - bezierPath.addCurve(to: CGPoint(x: 101.08, y: 119.17), controlPoint1: CGPoint(x: 95.26, y: 117.73), controlPoint2: CGPoint(x: 96.83, y: 119.17)) - bezierPath.addCurve(to: CGPoint(x: 110.88, y: 112.01), controlPoint1: CGPoint(x: 107.5, y: 119.17), controlPoint2: CGPoint(x: 110.88, y: 116.48)) - bezierPath.addCurve(to: CGPoint(x: 89.49, y: 99.25), controlPoint1: CGPoint(x: 110.88, y: 104.37), controlPoint2: CGPoint(x: 102.6, y: 99.25)) - bezierPath.addCurve(to: CGPoint(x: 76.56, y: 100.77), controlPoint1: CGPoint(x: 83.07, y: 99.25), controlPoint2: CGPoint(x: 80.21, y: 99.86)) - bezierPath.addLine(to: CGPoint(x: 71.88, y: 90.09)) - bezierPath.addCurve(to: CGPoint(x: 49.36, y: 73.17), controlPoint1: CGPoint(x: 67.28, y: 79.85), controlPoint2: CGPoint(x: 59.86, y: 73.17)) - bezierPath.addLine(to: CGPoint(x: 44.24, y: 73.17)) - bezierPath.addCurve(to: CGPoint(x: 41.42, y: 70.79), controlPoint1: CGPoint(x: 42.54, y: 73.17), controlPoint2: CGPoint(x: 41.42, y: 72.43)) - bezierPath.addCurve(to: CGPoint(x: 48.97, y: 67.44), controlPoint1: CGPoint(x: 41.42, y: 68.1), controlPoint2: CGPoint(x: 45.02, y: 67.44)) - bezierPath.addCurve(to: CGPoint(x: 76.59, y: 88.03), controlPoint1: CGPoint(x: 61.54, y: 67.44), controlPoint2: CGPoint(x: 70.85, y: 74.28)) - bezierPath.addLine(to: CGPoint(x: 79.77, y: 95.74)) - bezierPath.addCurve(to: CGPoint(x: 89.06, y: 94.82), controlPoint1: CGPoint(x: 82.68, y: 95.13), controlPoint2: CGPoint(x: 85.85, y: 94.82)) - bezierPath.addCurve(to: CGPoint(x: 96.44, y: 95.35), controlPoint1: CGPoint(x: 91.62, y: 94.82), controlPoint2: CGPoint(x: 93.96, y: 95)) - bezierPath.addLine(to: CGPoint(x: 97.08, y: 94.87)) - bezierPath.addCurve(to: CGPoint(x: 106.46, y: 89.44), controlPoint1: CGPoint(x: 99.57, y: 93.07), controlPoint2: CGPoint(x: 102.43, y: 91.2)) - bezierPath.addCurve(to: CGPoint(x: 122.64, y: 94.87), controlPoint1: CGPoint(x: 111.32, y: 92.74), controlPoint2: CGPoint(x: 116.87, y: 94.87)) - bezierPath.addLine(to: CGPoint(x: 123.35, y: 94.86)) - bezierPath.addCurve(to: CGPoint(x: 140, y: 80.94), controlPoint1: CGPoint(x: 134.83, y: 94.76), controlPoint2: CGPoint(x: 140, y: 92.04)) - bezierPath.addCurve(to: CGPoint(x: 116.96, y: 57.07), controlPoint1: CGPoint(x: 140, y: 67.27), controlPoint2: CGPoint(x: 130.11, y: 57.03)) - bezierPath.addLine(to: CGPoint(x: 105.33, y: 41.58)) - bezierPath.addCurve(to: CGPoint(x: 83.29, y: 29), controlPoint1: CGPoint(x: 98.78, y: 33.08), controlPoint2: CGPoint(x: 91.01, y: 29)) - bezierPath.addCurve(to: CGPoint(x: 67.54, y: 37.77), controlPoint1: CGPoint(x: 76.95, y: 29), controlPoint2: CGPoint(x: 67.54, y: 32.64)) - bezierPath.addCurve(to: CGPoint(x: 79.71, y: 49.27), controlPoint1: CGPoint(x: 67.54, y: 41.18), controlPoint2: CGPoint(x: 74.33, y: 45.93)) - bezierPath.addLine(to: CGPoint(x: 104.98, y: 64.71)) - bezierPath.addCurve(to: CGPoint(x: 99.13, y: 67.57), controlPoint1: CGPoint(x: 103.03, y: 66.58), controlPoint2: CGPoint(x: 101.3, y: 67.57)) - bezierPath.addCurve(to: CGPoint(x: 87.02, y: 62.5), controlPoint1: CGPoint(x: 95.78, y: 67.57), controlPoint2: CGPoint(x: 92.27, y: 65.54)) - bezierPath.addLine(to: CGPoint(x: 85.24, y: 61.46)) - bezierPath.addCurve(to: CGPoint(x: 49.44, y: 47.53), controlPoint1: CGPoint(x: 72.72, y: 54.14), controlPoint2: CGPoint(x: 62.71, y: 47.53)) - bezierPath.addCurve(to: CGPoint(x: 18.16, y: 71.96), controlPoint1: CGPoint(x: 34.99, y: 47.53), controlPoint2: CGPoint(x: 24.02, y: 55.82)) - bezierPath.addCurve(to: CGPoint(x: 10, y: 79.46), controlPoint1: CGPoint(x: 13.51, y: 71.96), controlPoint2: CGPoint(x: 10, y: 74.99)) - bezierPath.addCurve(to: CGPoint(x: 19.46, y: 87.66), controlPoint1: CGPoint(x: 10, y: 84.5), controlPoint2: CGPoint(x: 13.99, y: 87.66)) - bezierPath.addCurve(to: CGPoint(x: 48.44, y: 100.07), controlPoint1: CGPoint(x: 25.79, y: 96.52), controlPoint2: CGPoint(x: 36.16, y: 100.07)) - bezierPath.addCurve(to: CGPoint(x: 50.4, y: 100.03), controlPoint1: CGPoint(x: 49.1, y: 100.07), controlPoint2: CGPoint(x: 49.75, y: 100.03)) - bezierPath.addLine(to: CGPoint(x: 67.97, y: 114.61)) - bezierPath.addCurve(to: CGPoint(x: 78.12, y: 119.17), controlPoint1: CGPoint(x: 72.31, y: 118.56), controlPoint2: CGPoint(x: 74.83, y: 119.17)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 121.65, y: 78.86)) - bezierPath.addCurve(to: CGPoint(x: 118.13, y: 75.3), controlPoint1: CGPoint(x: 119.69, y: 78.86), controlPoint2: CGPoint(x: 118.13, y: 77.21)) - bezierPath.addCurve(to: CGPoint(x: 121.69, y: 71.61), controlPoint1: CGPoint(x: 118.13, y: 73.35), controlPoint2: CGPoint(x: 119.74, y: 71.61)) - bezierPath.addCurve(to: CGPoint(x: 125.25, y: 75.12), controlPoint1: CGPoint(x: 123.68, y: 71.61), controlPoint2: CGPoint(x: 125.25, y: 73.17)) - bezierPath.addCurve(to: CGPoint(x: 121.65, y: 78.86), controlPoint1: CGPoint(x: 125.25, y: 77.08), controlPoint2: CGPoint(x: 123.64, y: 78.86)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 46.75, y: 122.59)) - bezierPath.addCurve(to: CGPoint(x: 31.65, y: 112.92), controlPoint1: CGPoint(x: 37.55, y: 122.59), controlPoint2: CGPoint(x: 31.65, y: 118.73)) - bezierPath.addCurve(to: CGPoint(x: 39.51, y: 106.41), controlPoint1: CGPoint(x: 31.65, y: 109.01), controlPoint2: CGPoint(x: 34.65, y: 106.41)) - bezierPath.addCurve(to: CGPoint(x: 48.7, y: 107.06), controlPoint1: CGPoint(x: 43.32, y: 106.41), controlPoint2: CGPoint(x: 46.54, y: 107.06)) - bezierPath.addCurve(to: CGPoint(x: 50.96, y: 106.93), controlPoint1: CGPoint(x: 49.62, y: 107.06), controlPoint2: CGPoint(x: 50.35, y: 106.97)) - bezierPath.addLine(to: CGPoint(x: 64.41, y: 118.13)) - bezierPath.addCurve(to: CGPoint(x: 46.75, y: 122.59), controlPoint1: CGPoint(x: 60.25, y: 120.99), controlPoint2: CGPoint(x: 55.13, y: 122.59)) - bezierPath.close() - color.setFill() - bezierPath.fill() - - context.restoreGState() - - } - - public static func drawNotifications(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 150, height: 150), resizing: ResizingBehavior = .aspectFit, color: UIColor = UIColor(red: 0.000, green: 0.478, blue: 1.000, alpha: 1.000)) { - - let context = UIGraphicsGetCurrentContext()! - - - context.saveGState() - let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 150, height: 150), target: targetFrame) - context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) - context.scaleBy(x: resizedFrame.width / 150, y: resizedFrame.height / 150) - - let bezierPath = UIBezierPath() - bezierPath.move(to: CGPoint(x: 35.37, y: 107.25)) - bezierPath.addLine(to: CGPoint(x: 112.77, y: 107.25)) - bezierPath.addCurve(to: CGPoint(x: 120.14, y: 101.34), controlPoint1: CGPoint(x: 117.36, y: 107.25), controlPoint2: CGPoint(x: 120.14, y: 104.86)) - bezierPath.addCurve(to: CGPoint(x: 110.96, y: 87.72), controlPoint1: CGPoint(x: 120.14, y: 96.46), controlPoint2: CGPoint(x: 115.16, y: 92.07)) - bezierPath.addCurve(to: CGPoint(x: 106.47, y: 71.8), controlPoint1: CGPoint(x: 107.74, y: 84.35), controlPoint2: CGPoint(x: 106.86, y: 77.42)) - bezierPath.addLine(to: CGPoint(x: 106.44, y: 70.68)) - bezierPath.addCurve(to: CGPoint(x: 88.16, y: 35.43), controlPoint1: CGPoint(x: 105.92, y: 52.54), controlPoint2: CGPoint(x: 100.88, y: 40.02)) - bezierPath.addCurve(to: CGPoint(x: 74.04, y: 24), controlPoint1: CGPoint(x: 86.3, y: 29.08), controlPoint2: CGPoint(x: 81.27, y: 24)) - bezierPath.addCurve(to: CGPoint(x: 59.98, y: 35.43), controlPoint1: CGPoint(x: 66.87, y: 24), controlPoint2: CGPoint(x: 61.79, y: 29.08)) - bezierPath.addCurve(to: CGPoint(x: 41.67, y: 71.8), controlPoint1: CGPoint(x: 46.99, y: 40.11), controlPoint2: CGPoint(x: 42.01, y: 53.05)) - bezierPath.addLine(to: CGPoint(x: 41.58, y: 73.05)) - bezierPath.addCurve(to: CGPoint(x: 37.18, y: 87.72), controlPoint1: CGPoint(x: 41.14, y: 78.41), controlPoint2: CGPoint(x: 40.17, y: 84.6)) - bezierPath.addLine(to: CGPoint(x: 36.06, y: 88.86)) - bezierPath.addCurve(to: CGPoint(x: 28, y: 101.34), controlPoint1: CGPoint(x: 32.11, y: 92.83), controlPoint2: CGPoint(x: 28, y: 96.89)) - bezierPath.addCurve(to: CGPoint(x: 35.37, y: 107.25), controlPoint1: CGPoint(x: 28, y: 104.86), controlPoint2: CGPoint(x: 30.73, y: 107.25)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 74.04, y: 126.78)) - bezierPath.addCurve(to: CGPoint(x: 59.1, y: 113.89), controlPoint1: CGPoint(x: 65.79, y: 126.78), controlPoint2: CGPoint(x: 59.74, y: 120.73)) - bezierPath.addLine(to: CGPoint(x: 89.04, y: 113.89)) - bezierPath.addCurve(to: CGPoint(x: 74.04, y: 126.78), controlPoint1: CGPoint(x: 88.4, y: 120.73), controlPoint2: CGPoint(x: 82.35, y: 126.78)) - bezierPath.close() - color.setFill() - bezierPath.fill() - - context.restoreGState() - - } - - public static func drawPhotos(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 150, height: 150), resizing: ResizingBehavior = .aspectFit, color: UIColor = UIColor(red: 0.000, green: 0.478, blue: 1.000, alpha: 1.000)) { - - let context = UIGraphicsGetCurrentContext()! - - - context.saveGState() - let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 150, height: 150), target: targetFrame) - context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) - context.scaleBy(x: resizedFrame.width / 150, y: resizedFrame.height / 150) - - let bezierPath = UIBezierPath() - bezierPath.move(to: CGPoint(x: 32.33, y: 120.89)) - bezierPath.addLine(to: CGPoint(x: 116.8, y: 120.89)) - bezierPath.addCurve(to: CGPoint(x: 132.14, y: 105.76), controlPoint1: CGPoint(x: 127.06, y: 120.89), controlPoint2: CGPoint(x: 132.14, y: 115.81)) - bezierPath.addLine(to: CGPoint(x: 132.14, y: 46.14)) - bezierPath.addCurve(to: CGPoint(x: 116.8, y: 31), controlPoint1: CGPoint(x: 132.14, y: 36.08), controlPoint2: CGPoint(x: 127.06, y: 31)) - bezierPath.addLine(to: CGPoint(x: 32.33, y: 31)) - bezierPath.addCurve(to: CGPoint(x: 17, y: 46.14), controlPoint1: CGPoint(x: 22.13, y: 31), controlPoint2: CGPoint(x: 17, y: 36.03)) - bezierPath.addLine(to: CGPoint(x: 17, y: 105.76)) - bezierPath.addCurve(to: CGPoint(x: 32.33, y: 120.89), controlPoint1: CGPoint(x: 17, y: 115.86), controlPoint2: CGPoint(x: 22.13, y: 120.89)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 53.62, y: 77.14)) - bezierPath.addCurve(to: CGPoint(x: 41.56, y: 65.08), controlPoint1: CGPoint(x: 46.98, y: 77.14), controlPoint2: CGPoint(x: 41.56, y: 71.72)) - bezierPath.addCurve(to: CGPoint(x: 53.62, y: 53.02), controlPoint1: CGPoint(x: 41.56, y: 58.49), controlPoint2: CGPoint(x: 46.98, y: 53.02)) - bezierPath.addCurve(to: CGPoint(x: 65.63, y: 65.08), controlPoint1: CGPoint(x: 60.21, y: 53.02), controlPoint2: CGPoint(x: 65.63, y: 58.49)) - bezierPath.addCurve(to: CGPoint(x: 53.62, y: 77.14), controlPoint1: CGPoint(x: 65.63, y: 71.72), controlPoint2: CGPoint(x: 60.21, y: 77.14)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 32.43, y: 113.03)) - bezierPath.addCurve(to: CGPoint(x: 24.86, y: 105.41), controlPoint1: CGPoint(x: 27.69, y: 113.03), controlPoint2: CGPoint(x: 24.86, y: 110.2)) - bezierPath.addLine(to: CGPoint(x: 24.86, y: 102.44)) - bezierPath.addLine(to: CGPoint(x: 39.85, y: 89.35)) - bezierPath.addCurve(to: CGPoint(x: 46.49, y: 86.47), controlPoint1: CGPoint(x: 42, y: 87.45), controlPoint2: CGPoint(x: 44.34, y: 86.47)) - bezierPath.addCurve(to: CGPoint(x: 53.52, y: 89.45), controlPoint1: CGPoint(x: 48.88, y: 86.47), controlPoint2: CGPoint(x: 51.38, y: 87.45)) - bezierPath.addLine(to: CGPoint(x: 62.85, y: 97.85)) - bezierPath.addLine(to: CGPoint(x: 86.19, y: 77.14)) - bezierPath.addCurve(to: CGPoint(x: 94.05, y: 74.02), controlPoint1: CGPoint(x: 88.58, y: 74.99), controlPoint2: CGPoint(x: 91.27, y: 74.02)) - bezierPath.addCurve(to: CGPoint(x: 101.81, y: 77.19), controlPoint1: CGPoint(x: 96.74, y: 74.02), controlPoint2: CGPoint(x: 99.52, y: 75.04)) - bezierPath.addLine(to: CGPoint(x: 124.28, y: 97.99)) - bezierPath.addLine(to: CGPoint(x: 124.28, y: 105.51)) - bezierPath.addCurve(to: CGPoint(x: 116.76, y: 113.03), controlPoint1: CGPoint(x: 124.28, y: 110.2), controlPoint2: CGPoint(x: 121.39, y: 113.03)) - bezierPath.addLine(to: CGPoint(x: 32.43, y: 113.03)) - bezierPath.close() - color.setFill() - bezierPath.fill() - - context.restoreGState() - - } - - public static func drawReminders(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 150, height: 150), resizing: ResizingBehavior = .aspectFit, color: UIColor = UIColor(red: 0.000, green: 0.478, blue: 1.000, alpha: 1.000)) { - - let context = UIGraphicsGetCurrentContext()! - - - context.saveGState() - let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 150, height: 150), target: targetFrame) - context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) - context.scaleBy(x: resizedFrame.width / 150, y: resizedFrame.height / 150) - - let bezierPath = UIBezierPath() - bezierPath.move(to: CGPoint(x: 31.33, y: 117.35)) - bezierPath.addLine(to: CGPoint(x: 115.8, y: 117.35)) - bezierPath.addCurve(to: CGPoint(x: 131.14, y: 102.21), controlPoint1: CGPoint(x: 126.06, y: 117.35), controlPoint2: CGPoint(x: 131.14, y: 112.27)) - bezierPath.addLine(to: CGPoint(x: 131.14, y: 75.26)) - bezierPath.addCurve(to: CGPoint(x: 128.35, y: 65.98), controlPoint1: CGPoint(x: 131.14, y: 70.87), controlPoint2: CGPoint(x: 130.45, y: 68.81)) - bezierPath.addLine(to: CGPoint(x: 111.51, y: 43.18)) - bezierPath.addCurve(to: CGPoint(x: 94.97, y: 34), controlPoint1: CGPoint(x: 106.27, y: 36.02), controlPoint2: CGPoint(x: 103.35, y: 34.06)) - bezierPath.addLine(to: CGPoint(x: 52.57, y: 34)) - bezierPath.addCurve(to: CGPoint(x: 35.68, y: 43.18), controlPoint1: CGPoint(x: 43.88, y: 34), controlPoint2: CGPoint(x: 41, y: 35.9)) - bezierPath.addLine(to: CGPoint(x: 18.78, y: 65.98)) - bezierPath.addCurve(to: CGPoint(x: 16, y: 75.26), controlPoint1: CGPoint(x: 16.73, y: 68.81), controlPoint2: CGPoint(x: 16, y: 70.87)) - bezierPath.addLine(to: CGPoint(x: 16, y: 102.21)) - bezierPath.addCurve(to: CGPoint(x: 31.33, y: 117.35), controlPoint1: CGPoint(x: 16, y: 112.32), controlPoint2: CGPoint(x: 21.13, y: 117.35)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 73.57, y: 89.08)) - bezierPath.addCurve(to: CGPoint(x: 61.56, y: 77), controlPoint1: CGPoint(x: 66.36, y: 89.08), controlPoint2: CGPoint(x: 61.7, y: 82.92)) - bezierPath.addLine(to: CGPoint(x: 61.56, y: 76.58)) - bezierPath.addCurve(to: CGPoint(x: 57.5, y: 72.33), controlPoint1: CGPoint(x: 61.56, y: 74.38), controlPoint2: CGPoint(x: 60.24, y: 72.33)) - bezierPath.addLine(to: CGPoint(x: 26.4, y: 72.33)) - bezierPath.addCurve(to: CGPoint(x: 25.23, y: 69.89), controlPoint1: CGPoint(x: 24.79, y: 72.33), controlPoint2: CGPoint(x: 24.45, y: 70.96)) - bezierPath.addLine(to: CGPoint(x: 43.29, y: 45.08)) - bezierPath.addCurve(to: CGPoint(x: 51.99, y: 40.84), controlPoint1: CGPoint(x: 45.54, y: 41.96), controlPoint2: CGPoint(x: 48.42, y: 40.84)) - bezierPath.addLine(to: CGPoint(x: 95.15, y: 40.84)) - bezierPath.addCurve(to: CGPoint(x: 103.84, y: 45.08), controlPoint1: CGPoint(x: 98.71, y: 40.84), controlPoint2: CGPoint(x: 101.6, y: 41.96)) - bezierPath.addLine(to: CGPoint(x: 121.91, y: 69.89)) - bezierPath.addCurve(to: CGPoint(x: 120.74, y: 72.33), controlPoint1: CGPoint(x: 122.64, y: 70.96), controlPoint2: CGPoint(x: 122.35, y: 72.33)) - bezierPath.addLine(to: CGPoint(x: 89.63, y: 72.33)) - bezierPath.addCurve(to: CGPoint(x: 85.63, y: 76.38), controlPoint1: CGPoint(x: 86.98, y: 72.33), controlPoint2: CGPoint(x: 85.71, y: 74.26)) - bezierPath.addLine(to: CGPoint(x: 85.63, y: 76.72)) - bezierPath.addCurve(to: CGPoint(x: 73.57, y: 89.08), controlPoint1: CGPoint(x: 85.63, y: 82.73), controlPoint2: CGPoint(x: 80.94, y: 89.08)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 94.12, y: 48.01)) - bezierPath.addLine(to: CGPoint(x: 53.06, y: 48.01)) - bezierPath.addCurve(to: CGPoint(x: 50.72, y: 50.36), controlPoint1: CGPoint(x: 51.74, y: 48.01), controlPoint2: CGPoint(x: 50.72, y: 49.04)) - bezierPath.addCurve(to: CGPoint(x: 53.06, y: 52.7), controlPoint1: CGPoint(x: 50.72, y: 51.68), controlPoint2: CGPoint(x: 51.74, y: 52.7)) - bezierPath.addLine(to: CGPoint(x: 94.12, y: 52.7)) - bezierPath.addCurve(to: CGPoint(x: 96.42, y: 50.36), controlPoint1: CGPoint(x: 95.44, y: 52.7), controlPoint2: CGPoint(x: 96.42, y: 51.68)) - bezierPath.addCurve(to: CGPoint(x: 94.12, y: 48.01), controlPoint1: CGPoint(x: 96.42, y: 49.04), controlPoint2: CGPoint(x: 95.44, y: 48.01)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 100.57, y: 59.05)) - bezierPath.addCurve(to: CGPoint(x: 103.01, y: 61.59), controlPoint1: CGPoint(x: 101.94, y: 59.05), controlPoint2: CGPoint(x: 103.01, y: 60.27)) - bezierPath.addCurve(to: CGPoint(x: 100.57, y: 64.03), controlPoint1: CGPoint(x: 103.01, y: 62.91), controlPoint2: CGPoint(x: 101.94, y: 64.03)) - bezierPath.addLine(to: CGPoint(x: 46.57, y: 64.03)) - bezierPath.addCurve(to: CGPoint(x: 44.17, y: 61.59), controlPoint1: CGPoint(x: 45.2, y: 64.03), controlPoint2: CGPoint(x: 44.17, y: 62.91)) - bezierPath.addCurve(to: CGPoint(x: 46.57, y: 59.05), controlPoint1: CGPoint(x: 44.17, y: 60.27), controlPoint2: CGPoint(x: 45.2, y: 59.05)) - bezierPath.addLine(to: CGPoint(x: 100.57, y: 59.05)) - bezierPath.close() - color.setFill() - bezierPath.fill() - - context.restoreGState() - - } - - public static func drawSpeech(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 150, height: 150), resizing: ResizingBehavior = .aspectFit, color: UIColor = UIColor(red: 0.000, green: 0.478, blue: 1.000, alpha: 1.000)) { - - let context = UIGraphicsGetCurrentContext()! - - - context.saveGState() - let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 150, height: 150), target: targetFrame) - context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) - context.scaleBy(x: resizedFrame.width / 150, y: resizedFrame.height / 150) - - let bezierPath = UIBezierPath() - bezierPath.move(to: CGPoint(x: 89.37, y: 32.61)) - bezierPath.addLine(to: CGPoint(x: 116.27, y: 59.51)) - bezierPath.addCurve(to: CGPoint(x: 116.96, y: 31.92), controlPoint1: CGPoint(x: 124.87, y: 50.97), controlPoint2: CGPoint(x: 125.21, y: 40.13)) - bezierPath.addCurve(to: CGPoint(x: 89.37, y: 32.61), controlPoint1: CGPoint(x: 108.75, y: 23.82), controlPoint2: CGPoint(x: 97.96, y: 24.01)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 84.49, y: 37.54)) - bezierPath.addCurve(to: CGPoint(x: 77.89, y: 54.04), controlPoint1: CGPoint(x: 79.31, y: 42.62), controlPoint2: CGPoint(x: 77.16, y: 48.43)) - bezierPath.addLine(to: CGPoint(x: 32.53, y: 102.92)) - bezierPath.addCurve(to: CGPoint(x: 32.68, y: 110), controlPoint1: CGPoint(x: 30.68, y: 104.92), controlPoint2: CGPoint(x: 30.38, y: 107.71)) - bezierPath.addLine(to: CGPoint(x: 26.43, y: 118.06)) - bezierPath.addCurve(to: CGPoint(x: 26.67, y: 120.84), controlPoint1: CGPoint(x: 25.84, y: 118.84), controlPoint2: CGPoint(x: 25.79, y: 119.96)) - bezierPath.addLine(to: CGPoint(x: 28.09, y: 122.31)) - bezierPath.addCurve(to: CGPoint(x: 30.92, y: 122.5), controlPoint1: CGPoint(x: 28.92, y: 123.14), controlPoint2: CGPoint(x: 30.04, y: 123.18)) - bezierPath.addLine(to: CGPoint(x: 38.98, y: 116.2)) - bezierPath.addCurve(to: CGPoint(x: 45.8, y: 116.5), controlPoint1: CGPoint(x: 41.12, y: 118.43), controlPoint2: CGPoint(x: 43.86, y: 118.22)) - bezierPath.addLine(to: CGPoint(x: 71.3, y: 92.91)) - bezierPath.addLine(to: CGPoint(x: 71.3, y: 120.79)) - bezierPath.addCurve(to: CGPoint(x: 75.75, y: 125.24), controlPoint1: CGPoint(x: 71.3, y: 123.28), controlPoint2: CGPoint(x: 73.26, y: 125.24)) - bezierPath.addCurve(to: CGPoint(x: 80.19, y: 120.79), controlPoint1: CGPoint(x: 78.24, y: 125.24), controlPoint2: CGPoint(x: 80.19, y: 123.28)) - bezierPath.addLine(to: CGPoint(x: 80.19, y: 91.93)) - bezierPath.addLine(to: CGPoint(x: 79.85, y: 84.95)) - bezierPath.addLine(to: CGPoint(x: 94.74, y: 71.13)) - bezierPath.addCurve(to: CGPoint(x: 111.34, y: 64.44), controlPoint1: CGPoint(x: 100.36, y: 71.87), controlPoint2: CGPoint(x: 106.26, y: 69.57)) - bezierPath.addLine(to: CGPoint(x: 84.49, y: 37.54)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 37.56, y: 106.92)) - bezierPath.addLine(to: CGPoint(x: 80.58, y: 61.32)) - bezierPath.addCurve(to: CGPoint(x: 83.66, y: 65.27), controlPoint1: CGPoint(x: 81.41, y: 62.69), controlPoint2: CGPoint(x: 82.44, y: 64)) - bezierPath.addCurve(to: CGPoint(x: 87.46, y: 68.45), controlPoint1: CGPoint(x: 84.88, y: 66.5), controlPoint2: CGPoint(x: 86.15, y: 67.57)) - bezierPath.addLine(to: CGPoint(x: 42.05, y: 111.42)) - bezierPath.addLine(to: CGPoint(x: 37.56, y: 106.92)) - bezierPath.close() - color.setFill() - bezierPath.fill() - - context.restoreGState() - - } - - public static func drawBluetooth(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 150, height: 150), resizing: ResizingBehavior = .aspectFit, color: UIColor = UIColor(red: 0.000, green: 0.478, blue: 1.000, alpha: 1.000)) { - let context = UIGraphicsGetCurrentContext()! - context.saveGState() - let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 150, height: 150), target: targetFrame) - context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) - context.scaleBy(x: resizedFrame.width / 150, y: resizedFrame.height / 150) - let bezierPath = UIBezierPath() - bezierPath.move(to: CGPoint(x: 102.34, y: 94.92)) - bezierPath.addLine(to: CGPoint(x: 78.9, y: 75.5)) - bezierPath.addLine(to: CGPoint(x: 102.34, y: 56.08)) - bezierPath.addCurve(to: CGPoint(x: 102.34, y: 49.02), controlPoint1: CGPoint(x: 104.55, y: 54.24), controlPoint2: CGPoint(x: 104.55, y: 50.86)) - bezierPath.addLine(to: CGPoint(x: 74.65, y: 26.07)) - bezierPath.addCurve(to: CGPoint(x: 67.08, y: 29.6), controlPoint1: CGPoint(x: 71.64, y: 23.58), controlPoint2: CGPoint(x: 67.08, y: 25.71)) - bezierPath.addLine(to: CGPoint(x: 67.08, y: 64.42)) - bezierPath.addLine(to: CGPoint(x: 51.88, y: 49.3)) - bezierPath.addCurve(to: CGPoint(x: 45.35, y: 49.3), controlPoint1: CGPoint(x: 50.08, y: 47.51), controlPoint2: CGPoint(x: 47.15, y: 47.51)) - bezierPath.addCurve(to: CGPoint(x: 45.35, y: 55.8), controlPoint1: CGPoint(x: 43.55, y: 51.1), controlPoint2: CGPoint(x: 43.55, y: 54)) - bezierPath.addLine(to: CGPoint(x: 65.17, y: 75.5)) - bezierPath.addLine(to: CGPoint(x: 45.35, y: 95.2)) - bezierPath.addCurve(to: CGPoint(x: 45.35, y: 101.7), controlPoint1: CGPoint(x: 43.55, y: 97), controlPoint2: CGPoint(x: 43.55, y: 99.9)) - bezierPath.addCurve(to: CGPoint(x: 51.88, y: 101.7), controlPoint1: CGPoint(x: 47.15, y: 103.49), controlPoint2: CGPoint(x: 50.08, y: 103.49)) - bezierPath.addLine(to: CGPoint(x: 67.08, y: 86.58)) - bezierPath.addLine(to: CGPoint(x: 67.08, y: 121.4)) - bezierPath.addCurve(to: CGPoint(x: 74.65, y: 124.93), controlPoint1: CGPoint(x: 67.08, y: 125.29), controlPoint2: CGPoint(x: 71.64, y: 127.42)) - bezierPath.addLine(to: CGPoint(x: 102.34, y: 101.98)) - bezierPath.addCurve(to: CGPoint(x: 102.34, y: 94.92), controlPoint1: CGPoint(x: 104.55, y: 100.14), controlPoint2: CGPoint(x: 104.55, y: 96.76)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 76, y: 39)) - bezierPath.addLine(to: CGPoint(x: 92, y: 52)) - bezierPath.addLine(to: CGPoint(x: 76, y: 65)) - bezierPath.addLine(to: CGPoint(x: 76, y: 39)) - bezierPath.close() - bezierPath.move(to: CGPoint(x: 76, y: 111)) - bezierPath.addLine(to: CGPoint(x: 76, y: 85)) - bezierPath.addLine(to: CGPoint(x: 92, y: 98)) - bezierPath.addLine(to: CGPoint(x: 76, y: 111)) - bezierPath.close() - color.setFill() - bezierPath.fill() - - context.restoreGState() - - } - - public static func drawTracking(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 150, height: 150), resizing: ResizingBehavior = .aspectFit, color: UIColor = UIColor(red: 0.000, green: 0.478, blue: 1.000, alpha: 1.000)) { - - let context = UIGraphicsGetCurrentContext()! - - context.saveGState() - let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 150, height: 150), target: targetFrame) - context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) - context.scaleBy(x: resizedFrame.width / 150, y: resizedFrame.height / 150) - - let bezierPath = UIBezierPath() - bezierPath.move(to: CGPoint(x: 75, y: 127.43)) - bezierPath.addCurve(to: CGPoint(x: 83.2, y: 124.32), controlPoint1: CGPoint(x: 77.52, y: 127.43), controlPoint2: CGPoint(x: 80.31, y: 126.31)) - bezierPath.addCurve(to: CGPoint(x: 131, y: 59.89), controlPoint1: CGPoint(x: 112.19, y: 105.49), controlPoint2: CGPoint(x: 131, y: 82.53)) - bezierPath.addCurve(to: CGPoint(x: 98.69, y: 24), controlPoint1: CGPoint(x: 131, y: 38.38), controlPoint2: CGPoint(x: 116.69, y: 24)) - bezierPath.addCurve(to: CGPoint(x: 75, y: 38.97), controlPoint1: CGPoint(x: 88.29, y: 24), controlPoint2: CGPoint(x: 80.31, y: 29.15)) - bezierPath.addCurve(to: CGPoint(x: 51.31, y: 24), controlPoint1: CGPoint(x: 69.69, y: 29.15), controlPoint2: CGPoint(x: 61.71, y: 24)) - bezierPath.addCurve(to: CGPoint(x: 19, y: 59.89), controlPoint1: CGPoint(x: 33.31, y: 24), controlPoint2: CGPoint(x: 19, y: 38.38)) - bezierPath.addCurve(to: CGPoint(x: 66.75, y: 124.32), controlPoint1: CGPoint(x: 19, y: 82.53), controlPoint2: CGPoint(x: 37.76, y: 105.49)) - bezierPath.addCurve(to: CGPoint(x: 75, y: 127.43), controlPoint1: CGPoint(x: 69.69, y: 126.31), controlPoint2: CGPoint(x: 72.48, y: 127.43)) - bezierPath.close() - color.setFill() - bezierPath.fill() - - context.restoreGState() - } - - @objc(StyleKitNameResizingBehavior) - public enum ResizingBehavior: Int { - case aspectFit /// The content is proportionally resized to fit into the target rectangle. - case aspectFill /// The content is proportionally resized to completely fill the target rectangle. - case stretch /// The content is stretched to match the entire target rectangle. - case center /// The content is centered in the target rectangle, but it is NOT resized. - - public func apply(rect: CGRect, target: CGRect) -> CGRect { - if rect == target || target == CGRect.zero { - return rect - } - - var scales = CGSize.zero - scales.width = abs(target.width / rect.width) - scales.height = abs(target.height / rect.height) - - switch self { - case .aspectFit: - scales.width = min(scales.width, scales.height) - scales.height = scales.width - case .aspectFill: - scales.width = max(scales.width, scales.height) - scales.height = scales.width - case .stretch: - break - case .center: - scales.width = 1 - scales.height = 1 - } - - var result = rect.standardized - result.size.width *= scales.width - result.size.height *= scales.height - result.origin.x = target.minX + (target.width - result.width) / 2 - result.origin.y = target.minY + (target.height - result.height) / 2 - return result - } - } -} -#endif diff --git a/Sources/PermissionsKit/Services/HapticService.swift b/Sources/PermissionsKit/Services/HapticService.swift deleted file mode 100644 index 8e0a18a..0000000 --- a/Sources/PermissionsKit/Services/HapticService.swift +++ /dev/null @@ -1,61 +0,0 @@ -// The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import UIKit - -#if os(iOS) -enum HapticService { - - static func impact(_ style: Style) { - - switch style { - case .light: - let generator = UIImpactFeedbackGenerator(style: .light) - generator.impactOccurred() - case .medium: - let generator = UIImpactFeedbackGenerator(style: .medium) - generator.impactOccurred() - case .heavy: - let generator = UIImpactFeedbackGenerator(style: .heavy) - generator.impactOccurred() - case .success: - let generator = UINotificationFeedbackGenerator() - generator.notificationOccurred(UINotificationFeedbackGenerator.FeedbackType.success) - case .warning: - let generator = UINotificationFeedbackGenerator() - generator.notificationOccurred(UINotificationFeedbackGenerator.FeedbackType.warning) - case .error: - let generator = UINotificationFeedbackGenerator() - generator.notificationOccurred(UINotificationFeedbackGenerator.FeedbackType.error) - } - } - - enum Style { - - case light - case medium - case heavy - case error - case success - case warning - } -} -#endif diff --git a/Sources/PermissionsKit/Services/PresenterService.swift b/Sources/PermissionsKit/Services/PresenterService.swift deleted file mode 100644 index 197d72f..0000000 --- a/Sources/PermissionsKit/Services/PresenterService.swift +++ /dev/null @@ -1,46 +0,0 @@ -// The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import UIKit - -enum PresenterService { - - @available(iOSApplicationExtension, unavailable) - static func presentAlertAboutDeniedPermission(_ permission: Permission, dataSource: PermissionsDataSource?, on controller: UIViewController) { - - let data = dataSource?.deniedPermissionAlertTexts(for: permission) - - /* - Text is nil and data sources was set. - So developer special return nil for alert texts. - In this case developer don't want show alert. - */ - if (data == nil) && (dataSource != nil) { return } - let texts = data ?? DeniedPermissionAlertTexts.default - - let alertController = UIAlertController(title: texts.titleText, message: texts.descriptionText, preferredStyle: .alert) - alertController.addAction(.init(title: texts.cancelText, style: .cancel)) - alertController.addAction(.init(title: texts.actionText, style: .default, handler: { _ in - permission.openSettingPage() - })) - controller.present(alertController, animated: true, completion: nil) - } -} diff --git a/Sources/PhotoLibraryPermission/PhotoLibraryPermission.swift b/Sources/PhotoLibraryPermission/PhotoLibraryPermission.swift index 2e36bbf..d1243c0 100644 --- a/Sources/PhotoLibraryPermission/PhotoLibraryPermission.swift +++ b/Sources/PhotoLibraryPermission/PhotoLibraryPermission.swift @@ -1,5 +1,5 @@ // The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) +// Copyright © 2022 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Sources/RemindersPermission/RemindersPermission.swift b/Sources/RemindersPermission/RemindersPermission.swift index 6f35996..bd04c4e 100644 --- a/Sources/RemindersPermission/RemindersPermission.swift +++ b/Sources/RemindersPermission/RemindersPermission.swift @@ -1,5 +1,5 @@ // The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) +// Copyright © 2022 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Sources/SiriPermission/SiriPermission.swift b/Sources/SiriPermission/SiriPermission.swift index 7ffbb0a..3b3ecfa 100644 --- a/Sources/SiriPermission/SiriPermission.swift +++ b/Sources/SiriPermission/SiriPermission.swift @@ -1,5 +1,5 @@ // The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) +// Copyright © 2022 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Sources/SpeechRecognizerPermission/SpeechPermission.swift b/Sources/SpeechRecognizerPermission/SpeechPermission.swift index 1fc5097..85924f2 100644 --- a/Sources/SpeechRecognizerPermission/SpeechPermission.swift +++ b/Sources/SpeechRecognizerPermission/SpeechPermission.swift @@ -1,5 +1,5 @@ // The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) +// Copyright © 2022 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Sources/TrackingPermission/TrackingPermission.swift b/Sources/TrackingPermission/TrackingPermission.swift index 34283f5..29acd81 100644 --- a/Sources/TrackingPermission/TrackingPermission.swift +++ b/Sources/TrackingPermission/TrackingPermission.swift @@ -1,5 +1,5 @@ // The MIT License (MIT) -// Copyright © 2020 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) +// Copyright © 2022 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal