diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 9f2e97fd..0350fe30 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -3,5 +3,5 @@ name: Bug report about: Create a report to help us improve title: '' labels: bug -assignees: ivanvorobei +assignees: ivanvorobei, svyatoynick --- diff --git a/.gitignore b/.gitignore index 736b1ea5..4f40064a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,6 @@ -# osX files +# macOS Files .DS_Store .Trashes # Swift Package Manager .swiftpm - -# User Interface -*UserInterfaceState.xcuserstate diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 17c5bd58..1a8eb1b2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,7 +1,6 @@ # Contributing -Here provided more info about project, contribution process and recomended changes. -Please, read it before pull request or create issue. +Here provided info about contribution process and recommendations. ## Codestyle @@ -28,32 +27,3 @@ Here you find all which using in project: - // MARK: - Internal - // MARK: - Models - // MARK: - Ovveride - -If you can't find valid, add new to codestyle agreements please. Other can be use if class is large and need struct it even without adding to codestyle agreements. - - -## Active Compilation Conditions - -List of using for permissions: - -- PERMISSIONKIT_CAMERA -- PERMISSIONKIT_CONTACTS -- PERMISSIONKIT_CALENDAR -- PERMISSIONKIT_PHOTOLIBRARY -- PERMISSIONKIT_NOTIFICATION -- PERMISSIONKIT_MICROPHONE -- PERMISSIONKIT_REMINDERS -- PERMISSIONKIT_SPEECHRECOGNIZER -- PERMISSIONKIT_LOCATION_WHENINUSE -- PERMISSIONKIT_LOCATION_ALWAYS -- PERMISSIONKIT_MOTION -- PERMISSIONKIT_MEDIA_LIBRARY -- PERMISSIONKIT_BLUETOOTH -- PERMISSIONKIT_TRACKING -- PERMISSIONKIT_SIRI - -List of using for code manage: - -- PERMISSIONKIT_SPM -- PERMISSIONKIT_COCOAPODS - diff --git a/Example Apps/Modules/Package.swift b/Example Apps/Modules/Package.swift deleted file mode 100644 index 144be8da..00000000 --- a/Example Apps/Modules/Package.swift +++ /dev/null @@ -1,44 +0,0 @@ -// swift-tools-version: 5.4 - -import PackageDescription - -let package = Package( - name: "Modules", - platforms: [ - .iOS(.v12), - .tvOS(.v12), - .watchOS(.v3) - ], - products: [ - .library(name: "Modules", targets: ["Modules"]), - ], - dependencies: [ - .package(name: "SparrowKit", url: "https://github.com/ivanvorobei/SparrowKit", .upToNextMajor(from: "3.6.1")), - .package(name: "PermissionsKit", path: "PermissionsKit") - ], - targets: [ - .target( - name: "Modules", - dependencies: [ - .product(name: "SparrowKit", package: "SparrowKit"), - .product(name: "CameraPermission", package: "PermissionsKit"), - .product(name: "PhotoLibraryPermission", package: "PermissionsKit"), - .product(name: "NotificationPermission", package: "PermissionsKit"), - .product(name: "MicrophonePermission", package: "PermissionsKit"), - .product(name: "CalendarPermission", package: "PermissionsKit"), - .product(name: "ContactsPermission", package: "PermissionsKit"), - .product(name: "RemindersPermission", package: "PermissionsKit"), - .product(name: "SpeechRecognizerPermission", package: "PermissionsKit"), - .product(name: "LocationWhenInUsePermission", package: "PermissionsKit"), - .product(name: "LocationAlwaysPermission", package: "PermissionsKit"), - .product(name: "MotionPermission", package: "PermissionsKit"), - .product(name: "MediaLibraryPermission", package: "PermissionsKit"), - .product(name: "BluetoothPermission", package: "PermissionsKit"), - .product(name: "TrackingPermission", package: "PermissionsKit"), - .product(name: "FaceIDPermission", package: "PermissionsKit"), - .product(name: "SiriPermission", package: "PermissionsKit"), - .product(name: "HealthPermission", package: "PermissionsKit") - ] - ), - ] -) diff --git a/Example Apps/Modules/Sources/Modules/Example.swift b/Example Apps/Modules/Sources/Modules/Example.swift deleted file mode 100644 index 43a96a53..00000000 --- a/Example Apps/Modules/Sources/Modules/Example.swift +++ /dev/null @@ -1,22 +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 diff --git a/Example Apps/PermissionsKit.xcodeproj/project.pbxproj b/Example Apps/PermissionsKit.xcodeproj/project.pbxproj deleted file mode 100644 index 65f98d9f..00000000 --- a/Example Apps/PermissionsKit.xcodeproj/project.pbxproj +++ /dev/null @@ -1,972 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 52; - objects = { - -/* Begin PBXBuildFile section */ - F42F10C626524EC600D5B314 /* InfoPlist.strings in Sources */ = {isa = PBXBuildFile; fileRef = F42F10C826524EC600D5B314 /* InfoPlist.strings */; }; - F4714D082652A46B00A8E4D2 /* Root.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4714D072652A46B00A8E4D2 /* Root.swift */; }; - F4714D0A2652A46B00A8E4D2 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4714D092652A46B00A8E4D2 /* ContentView.swift */; }; - F4714D152652A4B700A8E4D2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F471BDBF264A5995000693BC /* Assets.xcassets */; }; - F4714D162652A4C000A8E4D2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F471BDBF264A5995000693BC /* Assets.xcassets */; }; - F471BDB7264A5993000693BC /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F471BDB6264A5993000693BC /* AppDelegate.swift */; }; - F471BDBB264A5993000693BC /* RootController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F471BDBA264A5993000693BC /* RootController.swift */; }; - F471BDC0264A5995000693BC /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F471BDBF264A5995000693BC /* Assets.xcassets */; }; - F47CBAEA265001FF00A8A00F /* RootControllerExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F47CBAE9265001FF00A8A00F /* RootControllerExtension.swift */; }; - F47CBB10265182DD00A8A00F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F47CBB0A265182DC00A8A00F /* Assets.xcassets */; }; - F47CBB12265182DD00A8A00F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F47CBB0D265182DC00A8A00F /* AppDelegate.swift */; }; - F47CBB13265182DD00A8A00F /* RootController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F47CBB0F265182DC00A8A00F /* RootController.swift */; }; - F47CBB17265186CD00A8A00F /* RootControllerExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F47CBB16265186CD00A8A00F /* RootControllerExtension.swift */; }; - F492461A280C0C6100750C30 /* Modules in Frameworks */ = {isa = PBXBuildFile; productRef = F4924619280C0C6100750C30 /* Modules */; }; - F492461C280C0CAE00750C30 /* Modules in Frameworks */ = {isa = PBXBuildFile; productRef = F492461B280C0CAE00750C30 /* Modules */; }; - F4DED98E280B4B5500F53F0B /* Modules in Frameworks */ = {isa = PBXBuildFile; productRef = F4DED98D280B4B5500F53F0B /* Modules */; }; - F4E350E42651BC8800D2CA45 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F4E350E32651BC8800D2CA45 /* LaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - F471BDF0264A5E78000693BC /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = F4B9AD12264920FC001A0426 /* Project object */; - proxyType = 1; - remoteGlobalIDString = F471BDDF264A5C00000693BC; - remoteInfo = Sources; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - F471BDDA264A5BD3000693BC /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - F42F10C726524EC600D5B314 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - F42F10C926524EC900D5B314 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/InfoPlist.strings; sourceTree = ""; }; - F42F10CA265254A100D5B314 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/InfoPlist.strings; sourceTree = ""; }; - F4714D052652A46B00A8E4D2 /* iOS SwiftUI Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "iOS SwiftUI Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - F4714D072652A46B00A8E4D2 /* Root.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Root.swift; sourceTree = ""; }; - F4714D092652A46B00A8E4D2 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; - F4714D102652A46D00A8E4D2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - F471BDB3264A5993000693BC /* iOS Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "iOS Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - F471BDB6264A5993000693BC /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - F471BDBA264A5993000693BC /* RootController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootController.swift; sourceTree = ""; }; - F471BDBF264A5995000693BC /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - F471BDC4264A5995000693BC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - F47CBAE9265001FF00A8A00F /* RootControllerExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootControllerExtension.swift; sourceTree = ""; }; - F47CBAF72651826100A8A00F /* tvOS Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "tvOS Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - F47CBB052651826300A8A00F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - F47CBB0A265182DC00A8A00F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - F47CBB0D265182DC00A8A00F /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - F47CBB0F265182DC00A8A00F /* RootController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RootController.swift; sourceTree = ""; }; - F47CBB16265186CD00A8A00F /* RootControllerExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootControllerExtension.swift; sourceTree = ""; }; - F4C77E9E266D5A16001D5870 /* Entitlements.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Entitlements.entitlements; sourceTree = ""; }; - F4DED98B280B4AAD00F53F0B /* PermissionsKit */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = PermissionsKit; path = ..; sourceTree = ""; }; - F4DED98C280B4B3E00F53F0B /* Modules */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = Modules; sourceTree = ""; }; - F4E350E32651BC8800D2CA45 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - F4714D022652A46B00A8E4D2 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - F492461A280C0C6100750C30 /* Modules in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F471BDB0264A5993000693BC /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - F4DED98E280B4B5500F53F0B /* Modules in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F47CBAF42651826100A8A00F /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - F492461C280C0CAE00750C30 /* Modules in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - F42F10C326524EA400D5B314 /* Localization */ = { - isa = PBXGroup; - children = ( - F42F10C826524EC600D5B314 /* InfoPlist.strings */, - ); - path = Localization; - sourceTree = ""; - }; - F4714D062652A46B00A8E4D2 /* iOS SwiftUI Example */ = { - isa = PBXGroup; - children = ( - F4714D072652A46B00A8E4D2 /* Root.swift */, - F4714D092652A46B00A8E4D2 /* ContentView.swift */, - F4714D102652A46D00A8E4D2 /* Info.plist */, - ); - path = "iOS SwiftUI Example"; - sourceTree = ""; - }; - F471BDB4264A5993000693BC /* Products */ = { - isa = PBXGroup; - children = ( - F471BDB3264A5993000693BC /* iOS Example.app */, - F47CBAF72651826100A8A00F /* tvOS Example.app */, - F4714D052652A46B00A8E4D2 /* iOS SwiftUI Example.app */, - ); - name = Products; - sourceTree = ""; - }; - F471BDB5264A5993000693BC /* iOS Example */ = { - isa = PBXGroup; - children = ( - F471BDC8264A5B5F000693BC /* App */, - F471BDFC264A629A000693BC /* Recources */, - F471BDFB264A6291000693BC /* Scenes */, - F42F10C326524EA400D5B314 /* Localization */, - ); - path = "iOS Example"; - sourceTree = ""; - }; - F471BDC8264A5B5F000693BC /* App */ = { - isa = PBXGroup; - children = ( - F471BDC4264A5995000693BC /* Info.plist */, - F4C77E9E266D5A16001D5870 /* Entitlements.entitlements */, - F471BDB6264A5993000693BC /* AppDelegate.swift */, - F4E350E32651BC8800D2CA45 /* LaunchScreen.storyboard */, - ); - path = App; - sourceTree = ""; - }; - F471BDEE264A5E78000693BC /* Frameworks */ = { - isa = PBXGroup; - children = ( - ); - name = Frameworks; - sourceTree = ""; - }; - F471BDFB264A6291000693BC /* Scenes */ = { - isa = PBXGroup; - children = ( - F471BDBA264A5993000693BC /* RootController.swift */, - F47CBAE9265001FF00A8A00F /* RootControllerExtension.swift */, - ); - path = Scenes; - sourceTree = ""; - }; - F471BDFC264A629A000693BC /* Recources */ = { - isa = PBXGroup; - children = ( - F471BDBF264A5995000693BC /* Assets.xcassets */, - ); - path = Recources; - sourceTree = ""; - }; - F47CBAF82651826100A8A00F /* tvOS Example */ = { - isa = PBXGroup; - children = ( - F47CBB09265182DC00A8A00F /* App */, - F47CBB0E265182DC00A8A00F /* Scenes */, - F47CBB052651826300A8A00F /* Info.plist */, - ); - path = "tvOS Example"; - sourceTree = ""; - }; - F47CBB09265182DC00A8A00F /* App */ = { - isa = PBXGroup; - children = ( - F47CBB0D265182DC00A8A00F /* AppDelegate.swift */, - F47CBB0A265182DC00A8A00F /* Assets.xcassets */, - ); - path = App; - sourceTree = ""; - }; - F47CBB0E265182DC00A8A00F /* Scenes */ = { - isa = PBXGroup; - children = ( - F47CBB0F265182DC00A8A00F /* RootController.swift */, - F47CBB16265186CD00A8A00F /* RootControllerExtension.swift */, - ); - path = Scenes; - sourceTree = ""; - }; - F4B9AD11264920FC001A0426 = { - isa = PBXGroup; - children = ( - F4DED98C280B4B3E00F53F0B /* Modules */, - F4DED98B280B4AAD00F53F0B /* PermissionsKit */, - F471BDB5264A5993000693BC /* iOS Example */, - F4714D062652A46B00A8E4D2 /* iOS SwiftUI Example */, - F47CBAF82651826100A8A00F /* tvOS Example */, - F471BDB4264A5993000693BC /* Products */, - F471BDEE264A5E78000693BC /* Frameworks */, - ); - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - F4714D042652A46B00A8E4D2 /* iOS SwiftUI Example */ = { - isa = PBXNativeTarget; - buildConfigurationList = F4714D132652A46D00A8E4D2 /* Build configuration list for PBXNativeTarget "iOS SwiftUI Example" */; - buildPhases = ( - F4714D012652A46B00A8E4D2 /* Sources */, - F4714D022652A46B00A8E4D2 /* Frameworks */, - F4714D032652A46B00A8E4D2 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "iOS SwiftUI Example"; - packageProductDependencies = ( - F4924619280C0C6100750C30 /* Modules */, - ); - productName = "iOS SwiftUI Example"; - productReference = F4714D052652A46B00A8E4D2 /* iOS SwiftUI Example.app */; - productType = "com.apple.product-type.application"; - }; - F471BDB2264A5993000693BC /* iOS Example */ = { - isa = PBXNativeTarget; - buildConfigurationList = F471BDC5264A5995000693BC /* Build configuration list for PBXNativeTarget "iOS Example" */; - buildPhases = ( - F471BDAF264A5993000693BC /* Sources */, - F471BDB0264A5993000693BC /* Frameworks */, - F471BDB1264A5993000693BC /* Resources */, - F471BDDA264A5BD3000693BC /* Embed Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - F471BDF1264A5E78000693BC /* PBXTargetDependency */, - ); - name = "iOS Example"; - packageProductDependencies = ( - F4DED98D280B4B5500F53F0B /* Modules */, - ); - productName = "iOS Example"; - productReference = F471BDB3264A5993000693BC /* iOS Example.app */; - productType = "com.apple.product-type.application"; - }; - F47CBAF62651826100A8A00F /* tvOS Example */ = { - isa = PBXNativeTarget; - buildConfigurationList = F47CBB062651826300A8A00F /* Build configuration list for PBXNativeTarget "tvOS Example" */; - buildPhases = ( - F47CBAF32651826100A8A00F /* Sources */, - F47CBAF42651826100A8A00F /* Frameworks */, - F47CBAF52651826100A8A00F /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "tvOS Example"; - packageProductDependencies = ( - F492461B280C0CAE00750C30 /* Modules */, - ); - productName = "tvOS Example"; - productReference = F47CBAF72651826100A8A00F /* tvOS Example.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - F4B9AD12264920FC001A0426 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 1250; - LastUpgradeCheck = 1320; - TargetAttributes = { - F4714D042652A46B00A8E4D2 = { - CreatedOnToolsVersion = 12.5; - }; - F471BDB2264A5993000693BC = { - CreatedOnToolsVersion = 12.5; - }; - F47CBAF62651826100A8A00F = { - CreatedOnToolsVersion = 12.5; - }; - }; - }; - buildConfigurationList = F4B9AD15264920FC001A0426 /* Build configuration list for PBXProject "PermissionsKit" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ar, - ru, - ); - mainGroup = F4B9AD11264920FC001A0426; - packageReferences = ( - ); - productRefGroup = F471BDB4264A5993000693BC /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - F471BDB2264A5993000693BC /* iOS Example */, - F47CBAF62651826100A8A00F /* tvOS Example */, - F4714D042652A46B00A8E4D2 /* iOS SwiftUI Example */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - F4714D032652A46B00A8E4D2 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - F4714D152652A4B700A8E4D2 /* Assets.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F471BDB1264A5993000693BC /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - F471BDC0264A5995000693BC /* Assets.xcassets in Resources */, - F4E350E42651BC8800D2CA45 /* LaunchScreen.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F47CBAF52651826100A8A00F /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - F4714D162652A4C000A8E4D2 /* Assets.xcassets in Resources */, - F47CBB10265182DD00A8A00F /* Assets.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - F4714D012652A46B00A8E4D2 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - F4714D0A2652A46B00A8E4D2 /* ContentView.swift in Sources */, - F4714D082652A46B00A8E4D2 /* Root.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F471BDAF264A5993000693BC /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - F47CBAEA265001FF00A8A00F /* RootControllerExtension.swift in Sources */, - F471BDBB264A5993000693BC /* RootController.swift in Sources */, - F42F10C626524EC600D5B314 /* InfoPlist.strings in Sources */, - F471BDB7264A5993000693BC /* AppDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F47CBAF32651826100A8A00F /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - F47CBB17265186CD00A8A00F /* RootControllerExtension.swift in Sources */, - F47CBB12265182DD00A8A00F /* AppDelegate.swift in Sources */, - F47CBB13265182DD00A8A00F /* RootController.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - F471BDF1264A5E78000693BC /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - targetProxy = F471BDF0264A5E78000693BC /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - F42F10C826524EC600D5B314 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - F42F10C726524EC600D5B314 /* en */, - F42F10C926524EC900D5B314 /* ar */, - F42F10CA265254A100D5B314 /* ru */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - F4714D112652A46D00A8E4D2 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = ""; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_STYLE = Automatic; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - DEVELOPMENT_ASSET_PATHS = "\"iOS SwiftUI Example/Preview Content\""; - DEVELOPMENT_TEAM = ""; - ENABLE_PREVIEWS = YES; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = "$(SRCROOT)/iOS SwiftUI Example/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 14.5; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - ONLY_ACTIVE_ARCH = YES; - PRODUCT_BUNDLE_IDENTIFIER = io.sparrowcode.opensource.permissionskit.swiftui; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - F4714D122652A46D00A8E4D2 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = ""; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_STYLE = Automatic; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEVELOPMENT_ASSET_PATHS = "\"iOS SwiftUI Example/Preview Content\""; - DEVELOPMENT_TEAM = ""; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_PREVIEWS = YES; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = "$(SRCROOT)/iOS SwiftUI Example/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 14.5; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - PRODUCT_BUNDLE_IDENTIFIER = io.sparrowcode.opensource.permissionskit.swiftui; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - F471BDC6264A5995000693BC /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = ""; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_ENTITLEMENTS = "iOS Example/App/Entitlements.entitlements"; - CODE_SIGN_STYLE = Automatic; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - DEVELOPMENT_TEAM = ""; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = "iOS Example/App/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 12.1; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - ONLY_ACTIVE_ARCH = YES; - PRODUCT_BUNDLE_IDENTIFIER = io.sparrowcode.opensource.permissionskit.ios; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(PERMISSIONKIT_FLAGS)"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - F471BDC7264A5995000693BC /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = ""; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_ENTITLEMENTS = "iOS Example/App/Entitlements.entitlements"; - CODE_SIGN_STYLE = Automatic; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEVELOPMENT_TEAM = ""; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = "iOS Example/App/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 12.1; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - PRODUCT_BUNDLE_IDENTIFIER = io.sparrowcode.opensource.permissionskit.ios; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - F47CBB072651826300A8A00F /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = "Brand Assets"; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = ""; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_STYLE = Automatic; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - DEVELOPMENT_TEAM = ""; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = "tvOS Example/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - ONLY_ACTIVE_ARCH = YES; - PRODUCT_BUNDLE_IDENTIFIER = io.sparrowcode.opensource.permissionskit.tvos; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = appletvos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 12.1; - }; - name = Debug; - }; - F47CBB082651826300A8A00F /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = "Brand Assets"; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = ""; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_STYLE = Automatic; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEVELOPMENT_TEAM = ""; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = "tvOS Example/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - PRODUCT_BUNDLE_IDENTIFIER = io.sparrowcode.opensource.permissionskit.tvos; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = appletvos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 12.1; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - F4B9AD16264920FC001A0426 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - ONLY_ACTIVE_ARCH = YES; - }; - name = Debug; - }; - F4B9AD17264920FC001A0426 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - F4714D132652A46D00A8E4D2 /* Build configuration list for PBXNativeTarget "iOS SwiftUI Example" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F4714D112652A46D00A8E4D2 /* Debug */, - F4714D122652A46D00A8E4D2 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - F471BDC5264A5995000693BC /* Build configuration list for PBXNativeTarget "iOS Example" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F471BDC6264A5995000693BC /* Debug */, - F471BDC7264A5995000693BC /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - F47CBB062651826300A8A00F /* Build configuration list for PBXNativeTarget "tvOS Example" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F47CBB072651826300A8A00F /* Debug */, - F47CBB082651826300A8A00F /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - F4B9AD15264920FC001A0426 /* Build configuration list for PBXProject "PermissionsKit" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F4B9AD16264920FC001A0426 /* Debug */, - F4B9AD17264920FC001A0426 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - -/* Begin XCSwiftPackageProductDependency section */ - F4924619280C0C6100750C30 /* Modules */ = { - isa = XCSwiftPackageProductDependency; - productName = Modules; - }; - F492461B280C0CAE00750C30 /* Modules */ = { - isa = XCSwiftPackageProductDependency; - productName = Modules; - }; - F4DED98D280B4B5500F53F0B /* Modules */ = { - isa = XCSwiftPackageProductDependency; - productName = Modules; - }; -/* End XCSwiftPackageProductDependency section */ - }; - rootObject = F4B9AD12264920FC001A0426 /* Project object */; -} diff --git a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a6..00000000 --- a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d98100..00000000 --- a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved deleted file mode 100644 index f3cc2ffd..00000000 --- a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ /dev/null @@ -1,16 +0,0 @@ -{ - "object": { - "pins": [ - { - "package": "SparrowKit", - "repositoryURL": "https://github.com/ivanvorobei/SparrowKit", - "state": { - "branch": null, - "revision": "74690b7fcb54f060008878dfb1769eaac225d60b", - "version": "3.6.1" - } - } - ] - }, - "version": 1 -} diff --git a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/IDEFindNavigatorScopes.plist b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/IDEFindNavigatorScopes.plist deleted file mode 100644 index 5dd5da85..00000000 --- a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/IDEFindNavigatorScopes.plist +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 1).xcuserstate" "b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 1).xcuserstate" deleted file mode 100644 index a690174a..00000000 Binary files "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 1).xcuserstate" and /dev/null differ diff --git "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 10).xcuserstate" "b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 10).xcuserstate" deleted file mode 100644 index 631bc02a..00000000 Binary files "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 10).xcuserstate" and /dev/null differ diff --git "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 11).xcuserstate" "b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 11).xcuserstate" deleted file mode 100644 index dc255ef9..00000000 Binary files "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 11).xcuserstate" and /dev/null differ diff --git "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 2).xcuserstate" "b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 2).xcuserstate" deleted file mode 100644 index 3b671b7e..00000000 Binary files "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 2).xcuserstate" and /dev/null differ diff --git "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 3).xcuserstate" "b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 3).xcuserstate" deleted file mode 100644 index 335a9465..00000000 Binary files "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 3).xcuserstate" and /dev/null differ diff --git "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 4).xcuserstate" "b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 4).xcuserstate" deleted file mode 100644 index 12eac00f..00000000 Binary files "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 4).xcuserstate" and /dev/null differ diff --git "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 5).xcuserstate" "b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 5).xcuserstate" deleted file mode 100644 index 2cce144a..00000000 Binary files "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 5).xcuserstate" and /dev/null differ diff --git "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 6).xcuserstate" "b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 6).xcuserstate" deleted file mode 100644 index e12a775a..00000000 Binary files "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 6).xcuserstate" and /dev/null differ diff --git "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 7).xcuserstate" "b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 7).xcuserstate" deleted file mode 100644 index 24c1aaf3..00000000 Binary files "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 7).xcuserstate" and /dev/null differ diff --git "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 8).xcuserstate" "b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 8).xcuserstate" deleted file mode 100644 index 78990bf5..00000000 Binary files "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 8).xcuserstate" and /dev/null differ diff --git "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 9).xcuserstate" "b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 9).xcuserstate" deleted file mode 100644 index ec5a12ff..00000000 Binary files "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16 9).xcuserstate" and /dev/null differ diff --git "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16).xcuserstate" "b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16).xcuserstate" deleted file mode 100644 index dc1852c4..00000000 Binary files "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s Mac mini's conflicted copy 2021-05-16).xcuserstate" and /dev/null differ diff --git "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 1).xcuserstate" "b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 1).xcuserstate" deleted file mode 100644 index 1525b970..00000000 Binary files "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 1).xcuserstate" and /dev/null differ diff --git "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 10).xcuserstate" "b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 10).xcuserstate" deleted file mode 100644 index 90e7d411..00000000 Binary files "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 10).xcuserstate" and /dev/null differ diff --git "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 11).xcuserstate" "b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 11).xcuserstate" deleted file mode 100644 index 15dce66a..00000000 Binary files "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 11).xcuserstate" and /dev/null differ diff --git "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 12).xcuserstate" "b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 12).xcuserstate" deleted file mode 100644 index 3361265e..00000000 Binary files "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 12).xcuserstate" and /dev/null differ diff --git "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 13).xcuserstate" "b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 13).xcuserstate" deleted file mode 100644 index 5d4da253..00000000 Binary files "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 13).xcuserstate" and /dev/null differ diff --git "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 14).xcuserstate" "b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 14).xcuserstate" deleted file mode 100644 index aab62665..00000000 Binary files "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 14).xcuserstate" and /dev/null differ diff --git "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 15).xcuserstate" "b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 15).xcuserstate" deleted file mode 100644 index 10d1c883..00000000 Binary files "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 15).xcuserstate" and /dev/null differ diff --git "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 16).xcuserstate" "b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 16).xcuserstate" deleted file mode 100644 index 4f38d198..00000000 Binary files "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 16).xcuserstate" and /dev/null differ diff --git "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 2).xcuserstate" "b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 2).xcuserstate" deleted file mode 100644 index 6cd293c5..00000000 Binary files "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 2).xcuserstate" and /dev/null differ diff --git "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 3).xcuserstate" "b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 3).xcuserstate" deleted file mode 100644 index 123dfc46..00000000 Binary files "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 3).xcuserstate" and /dev/null differ diff --git "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 4).xcuserstate" "b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 4).xcuserstate" deleted file mode 100644 index 75b87c58..00000000 Binary files "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 4).xcuserstate" and /dev/null differ diff --git "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 5).xcuserstate" "b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 5).xcuserstate" deleted file mode 100644 index 840486d2..00000000 Binary files "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 5).xcuserstate" and /dev/null differ diff --git "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 6).xcuserstate" "b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 6).xcuserstate" deleted file mode 100644 index 69e7d277..00000000 Binary files "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 6).xcuserstate" and /dev/null differ diff --git "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 7).xcuserstate" "b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 7).xcuserstate" deleted file mode 100644 index 3ecdddc2..00000000 Binary files "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 7).xcuserstate" and /dev/null differ diff --git "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 8).xcuserstate" "b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 8).xcuserstate" deleted file mode 100644 index e300f4c0..00000000 Binary files "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 8).xcuserstate" and /dev/null differ diff --git "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 9).xcuserstate" "b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 9).xcuserstate" deleted file mode 100644 index 717fa037..00000000 Binary files "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16 9).xcuserstate" and /dev/null differ diff --git "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16).xcuserstate" "b/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16).xcuserstate" deleted file mode 100644 index 2063d5a3..00000000 Binary files "a/Example Apps/PermissionsKit.xcodeproj/project.xcworkspace/xcuserdata/ivanvorobei.xcuserdatad/UserInterfaceState (Ivan Vorobei\342\200\231s MacBook Pro 13's conflicted copy 2021-05-16).xcuserstate" and /dev/null differ diff --git a/Example Apps/PermissionsKit.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme b/Example Apps/PermissionsKit.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme deleted file mode 100644 index 6a6e6a97..00000000 --- a/Example Apps/PermissionsKit.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Example Apps/PermissionsKit.xcodeproj/xcshareddata/xcschemes/iOS SwiftUI Example.xcscheme b/Example Apps/PermissionsKit.xcodeproj/xcshareddata/xcschemes/iOS SwiftUI Example.xcscheme deleted file mode 100644 index f6fa988c..00000000 --- a/Example Apps/PermissionsKit.xcodeproj/xcshareddata/xcschemes/iOS SwiftUI Example.xcscheme +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Example Apps/PermissionsKit.xcodeproj/xcshareddata/xcschemes/tvOS Example.xcscheme b/Example Apps/PermissionsKit.xcodeproj/xcshareddata/xcschemes/tvOS Example.xcscheme deleted file mode 100644 index b02fb818..00000000 --- a/Example Apps/PermissionsKit.xcodeproj/xcshareddata/xcschemes/tvOS Example.xcscheme +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Example Apps/PermissionsKit.xcodeproj/xcuserdata/ivanvorobei.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/Example Apps/PermissionsKit.xcodeproj/xcuserdata/ivanvorobei.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist deleted file mode 100644 index f62ad930..00000000 --- a/Example Apps/PermissionsKit.xcodeproj/xcuserdata/ivanvorobei.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ /dev/null @@ -1,6 +0,0 @@ - - - diff --git a/Example Apps/PermissionsKit.xcodeproj/xcuserdata/ivanvorobei.xcuserdatad/xcschemes/xcschememanagement.plist b/Example Apps/PermissionsKit.xcodeproj/xcuserdata/ivanvorobei.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index 66b8c45d..00000000 --- a/Example Apps/PermissionsKit.xcodeproj/xcuserdata/ivanvorobei.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,42 +0,0 @@ - - - - - SchemeUserState - - iOS Example.xcscheme_^#shared#^_ - - orderHint - 0 - - iOS SwiftUI Example.xcscheme_^#shared#^_ - - orderHint - 1 - - tvOS Example.xcscheme_^#shared#^_ - - orderHint - 2 - - - SuppressBuildableAutocreation - - F4714D042652A46B00A8E4D2 - - primary - - - F471BDB2264A5993000693BC - - primary - - - F47CBAF62651826100A8A00F - - primary - - - - - diff --git a/Example Apps/PermissionsKit.xcodeproj/xcuserdata/pelevin.xcuserdatad/xcschemes/xcschememanagement.plist b/Example Apps/PermissionsKit.xcodeproj/xcuserdata/pelevin.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index 4c97c361..00000000 --- a/Example Apps/PermissionsKit.xcodeproj/xcuserdata/pelevin.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - SchemeUserState - - iOS Example.xcscheme_^#shared#^_ - - orderHint - 0 - - iOS SwiftUI Example.xcscheme_^#shared#^_ - - orderHint - 1 - - tvOS Example.xcscheme_^#shared#^_ - - orderHint - 2 - - - - diff --git a/Example Apps/iOS Example/App/AppDelegate.swift b/Example Apps/iOS Example/App/AppDelegate.swift deleted file mode 100644 index 90f71659..00000000 --- a/Example Apps/iOS Example/App/AppDelegate.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 -import SparrowKit - -@main -class AppDelegate: SPAppWindowDelegate { - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - makeKeyAndVisible(viewController: RootController().wrapToNavigationController(prefersLargeTitles: false), tint: .systemBlue) - return true - } -} - diff --git a/Example Apps/iOS Example/App/Entitlements.entitlements b/Example Apps/iOS Example/App/Entitlements.entitlements deleted file mode 100644 index 21d95c45..00000000 --- a/Example Apps/iOS Example/App/Entitlements.entitlements +++ /dev/null @@ -1,8 +0,0 @@ - - - - - com.apple.developer.siri - - - diff --git a/Example Apps/iOS Example/App/Info.plist b/Example Apps/iOS Example/App/Info.plist deleted file mode 100644 index 244a582c..00000000 --- a/Example Apps/iOS Example/App/Info.plist +++ /dev/null @@ -1,85 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleDisplayName - PermissionsKit - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - NSAppleMusicUsageDescription - Example Description - NSBluetoothAlwaysUsageDescription - Example Description - NSBluetoothPeripheralUsageDescription - Example Description - NSCalendarsUsageDescription - Example Description - NSCameraUsageDescription - Example Description - NSContactsUsageDescription - Example Description - NSFaceIDUsageDescription - Example Description - NSHomeKitUsageDescription - Example Description - NSLocationAlwaysAndWhenInUseUsageDescription - Example Description - NSLocationAlwaysUsageDescription - Example Description - NSLocationUsageDescription - Example Description - NSLocationWhenInUseUsageDescription - Example Description - NSMicrophoneUsageDescription - Example Description - NSMotionUsageDescription - Example Description - NSPhotoLibraryUsageDescription - Example Description - NSRemindersUsageDescription - Example Description - NSSiriUsageDescription - Example Description - NSSpeechRecognitionUsageDescription - Example Description - NSUserTrackingUsageDescription - Example Description - UIApplicationSupportsIndirectInputEvents - - UILaunchStoryboardName - LaunchScreen - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/Example Apps/iOS Example/App/LaunchScreen.storyboard b/Example Apps/iOS Example/App/LaunchScreen.storyboard deleted file mode 100644 index 80a5ad75..00000000 --- a/Example Apps/iOS Example/App/LaunchScreen.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Example Apps/iOS Example/Localization/ar.lproj/InfoPlist.strings b/Example Apps/iOS Example/Localization/ar.lproj/InfoPlist.strings deleted file mode 100644 index 8b137891..00000000 --- a/Example Apps/iOS Example/Localization/ar.lproj/InfoPlist.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Example Apps/iOS Example/Localization/en.lproj/InfoPlist.strings b/Example Apps/iOS Example/Localization/en.lproj/InfoPlist.strings deleted file mode 100644 index 8b137891..00000000 --- a/Example Apps/iOS Example/Localization/en.lproj/InfoPlist.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Example Apps/iOS Example/Localization/ru.lproj/InfoPlist.strings b/Example Apps/iOS Example/Localization/ru.lproj/InfoPlist.strings deleted file mode 100644 index 8b137891..00000000 --- a/Example Apps/iOS Example/Localization/ru.lproj/InfoPlist.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/Contents.json b/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 29d91251..00000000 --- a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "icon_20pt@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "icon_20pt@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "icon_29pt@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "icon_29pt@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "icon_40pt@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "icon_40pt@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "icon_60pt@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "icon_60pt@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "icon_20pt.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "icon_20pt@2x-1.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "icon_29pt.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "icon_29pt@2x-1.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "icon_40pt.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "icon_40pt@2x-1.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "icon_76pt.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "icon_76pt@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "icon_83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon.png", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/Icon.png b/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/Icon.png deleted file mode 100644 index 7fc6d795..00000000 Binary files a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/Icon.png and /dev/null differ diff --git a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_20pt.png b/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_20pt.png deleted file mode 100644 index 48f13500..00000000 Binary files a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_20pt.png and /dev/null differ diff --git a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_20pt@2x-1.png b/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_20pt@2x-1.png deleted file mode 100644 index d45361b8..00000000 Binary files a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_20pt@2x-1.png and /dev/null differ diff --git a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_20pt@2x.png b/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_20pt@2x.png deleted file mode 100644 index d45361b8..00000000 Binary files a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_20pt@2x.png and /dev/null differ diff --git a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_20pt@3x.png b/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_20pt@3x.png deleted file mode 100644 index 07cc020c..00000000 Binary files a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_20pt@3x.png and /dev/null differ diff --git a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_29pt.png b/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_29pt.png deleted file mode 100644 index 7f722696..00000000 Binary files a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_29pt.png and /dev/null differ diff --git a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_29pt@2x-1.png b/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_29pt@2x-1.png deleted file mode 100644 index c705ea28..00000000 Binary files a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_29pt@2x-1.png and /dev/null differ diff --git a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_29pt@2x.png b/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_29pt@2x.png deleted file mode 100644 index c705ea28..00000000 Binary files a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_29pt@2x.png and /dev/null differ diff --git a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_29pt@3x.png b/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_29pt@3x.png deleted file mode 100644 index c875e864..00000000 Binary files a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_29pt@3x.png and /dev/null differ diff --git a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_40pt.png b/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_40pt.png deleted file mode 100644 index d45361b8..00000000 Binary files a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_40pt.png and /dev/null differ diff --git a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_40pt@2x-1.png b/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_40pt@2x-1.png deleted file mode 100644 index 0463f7df..00000000 Binary files a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_40pt@2x-1.png and /dev/null differ diff --git a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_40pt@2x.png b/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_40pt@2x.png deleted file mode 100644 index 0463f7df..00000000 Binary files a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_40pt@2x.png and /dev/null differ diff --git a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_40pt@3x.png b/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_40pt@3x.png deleted file mode 100644 index 3c2d5e73..00000000 Binary files a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_40pt@3x.png and /dev/null differ diff --git a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_60pt@2x.png b/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_60pt@2x.png deleted file mode 100644 index 3c2d5e73..00000000 Binary files a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_60pt@2x.png and /dev/null differ diff --git a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_60pt@3x.png b/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_60pt@3x.png deleted file mode 100644 index 639d313d..00000000 Binary files a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_60pt@3x.png and /dev/null differ diff --git a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_76pt.png b/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_76pt.png deleted file mode 100644 index 256242b9..00000000 Binary files a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_76pt.png and /dev/null differ diff --git a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_76pt@2x.png b/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_76pt@2x.png deleted file mode 100644 index a5fac32b..00000000 Binary files a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_76pt@2x.png and /dev/null differ diff --git a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_83.5@2x.png b/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_83.5@2x.png deleted file mode 100644 index 3f499e5e..00000000 Binary files a/Example Apps/iOS Example/Recources/Assets.xcassets/AppIcon.appiconset/icon_83.5@2x.png and /dev/null differ diff --git a/Example Apps/iOS Example/Recources/Assets.xcassets/Contents.json b/Example Apps/iOS Example/Recources/Assets.xcassets/Contents.json deleted file mode 100644 index 73c00596..00000000 --- a/Example Apps/iOS Example/Recources/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/Example Apps/iOS Example/Scenes/RootController.swift b/Example Apps/iOS Example/Scenes/RootController.swift deleted file mode 100644 index 89c5ca11..00000000 --- a/Example Apps/iOS Example/Scenes/RootController.swift +++ /dev/null @@ -1,169 +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 -import SparrowKit - -import PermissionsKit -import CameraPermission -import PhotoLibraryPermission -import NotificationPermission -import MicrophonePermission -import CalendarPermission -import ContactsPermission -import RemindersPermission -import SpeechRecognizerPermission -import LocationWhenInUsePermission -import LocationAlwaysPermission -import MotionPermission -import MediaLibraryPermission -import BluetoothPermission -import TrackingPermission -import FaceIDPermission -import SiriPermission -import HealthPermission - -import CoreLocation - -class RootController: UITableViewController { - - var availablePermissions: [Permission] = [.camera, .photoLibrary, .notification, .microphone, .calendar, .contacts, .reminders, .speech, .locationWhenInUse, .locationAlways, .motion, .mediaLibrary, .bluetooth, /*.tracking,*/ .faceID, .siri, .health] - - var selectedPermissions: [Permission] = [] - - // MARK: Init - - init() { - if #available(iOS 13.0, *) { - super.init(style: .insetGrouped) - } else { - super.init(style: .plain) - } - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - // MARK: Lifecycle - - override func viewDidLoad() { - super.viewDidLoad() - navigationItem.title = "Choose Style" - - // Available styles: List, Dialog & Native. - let segmentedControl = UISegmentedControl(items: ["List", "Dialog", "Native"]) - navigationItem.titleView = segmentedControl - segmentedControl.selectedSegmentIndex = 0 - navigationItem.rightBarButtonItem = UIBarButtonItem.init(barButtonSystemItem: .play, target: self, action: #selector(self.requestPermissions)) - tableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell") - } - - // MARK: Actions - - @objc func requestPermissions() { - if selectedPermissions.isEmpty { return } - guard let segmentControl = navigationItem.titleView as? UISegmentedControl else { return } - switch segmentControl.selectedSegmentIndex { - case 0: - let controller = PermissionsKit.list(selectedPermissions) - controller.dataSource = self - controller.delegate = self - controller.present(on: self) - case 1: - let controller = PermissionsKit.dialog(selectedPermissions) - controller.dataSource = self - controller.delegate = self - //controller.bounceAnimationEnabled = false - //controller.allowSwipeDismiss = true - //controller.showCloseButton = true - controller.present(on: self) - case 2: - let controller = PermissionsKit.native(selectedPermissions) - controller.delegate = self - // controller.allowSwipeDismiss = true - // controller.showCloseButton = true - controller.present(on: self) - default: - break - } - } -} - -// MARK: - Permissions Data Source - -extension RootController: PermissionsDataSource { - - func configure(_ cell: PermissionTableViewCell, for permission: Permission) { - - // Here you can customise cell, like texts or colors. - - /* - cell.permissionTitleLabel.text = "Title" - cell.permissionDescriptionLabel.text = "Description" - */ - - // If you need change icon, choose one of this: - - /* - cell.permissionIconView.setPermissionType(.bluetooth) - cell.permissionIconView.setCustomImage(UIImage.init(named: "custom-name")) - cell.permissionIconView.setCustomView(YourView()) - */ - } - - func deniedPermissionAlertTexts(for permission: Permission) -> DeniedPermissionAlertTexts? { - // You can create custom texts - - /* - let texts = DeniedPermissionAlertTexts() - texts.titleText = "Permission denied" - texts.descriptionText = "Please, go to Settings and allow permission." - texts.actionText = "Settings" - texts.cancelText = "Cancel" - return texts - */ - - // or use default texts. - - return .default - - // For hide alert, simple return nil. - // return nil - } -} - -// MARK: - Permissions Delegate - -extension RootController: PermissionsDelegate { - - func didHidePermissions(_ permissions: [Permission]) { - print("Example App: did hide with permissions", permissions.map { $0.debugName }) - } - - func didAllowPermission(_ permission: Permission) { - print("Example App: did allow", permission.debugName) - } - - func didDeniedPermission(_ permission: Permission) { - print("Example App: did denied", permission.debugName) - } -} diff --git a/Example Apps/iOS Example/Scenes/RootControllerExtension.swift b/Example Apps/iOS Example/Scenes/RootControllerExtension.swift deleted file mode 100644 index c157836e..00000000 --- a/Example Apps/iOS Example/Scenes/RootControllerExtension.swift +++ /dev/null @@ -1,72 +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 - -// MARK: - Table Data Source & Delegate - -extension RootController { - - override func numberOfSections(in tableView: UITableView) -> Int { - return 1 - } - - override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return availablePermissions.count - } - - override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) - let permission = availablePermissions[indexPath.row] - cell.textLabel?.text = permission.localisedName - cell.accessoryType = selectedPermissions.contains(permission) ? .checkmark : .none - cell.selectionStyle = .none - return cell - } - - override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - let cell = tableView.cellForRow(at: indexPath) - let permission = availablePermissions[indexPath.row] - if selectedPermissions.contains(permission) { - cell?.accessoryType = .none - selectedPermissions = selectedPermissions.filter { $0 != permission } - } else { - cell?.accessoryType = .checkmark - selectedPermissions.append(permission) - } - - print("--- \(permission.localisedName) ---") - switch permission.status { - case .authorized: print("authorised") - case .denied: print("authorised") - case .notDetermined: print("notDetermined") - default: break - } - } - - override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { - return "Choose permissions" - } - - override func tableView(_ tableView: UITableView, titleForFooterInSection section: Int) -> String? { - return "All need keys added. When you add `PermissionsKit` to your project, need add some keys in Info.plist. See Readme.md for details." - } -} diff --git a/Example Apps/iOS SwiftUI Example/ContentView.swift b/Example Apps/iOS SwiftUI Example/ContentView.swift deleted file mode 100644 index faefafc8..00000000 --- a/Example Apps/iOS SwiftUI Example/ContentView.swift +++ /dev/null @@ -1,38 +0,0 @@ -import SwiftUI - -import PermissionsKit -import CameraPermission -import PhotoLibraryPermission -import NotificationPermission -import MicrophonePermission -import CalendarPermission -import ContactsPermission -import RemindersPermission -import SpeechRecognizerPermission -import LocationWhenInUsePermission -import LocationAlwaysPermission -import MotionPermission -import MediaLibraryPermission -import BluetoothPermission -import TrackingPermission - -struct ContentView: View { - - @State private var showingPermisionsController = false - - var body: some View { - Button("Show Request") { - self.showingPermisionsController = true - } - .padding() - .sheet(isPresented: $showingPermisionsController) { - PermissionsList(permissions: [.camera, .contacts]) - } - } -} - -struct ContentView_Previews: PreviewProvider { - static var previews: some View { - ContentView() - } -} diff --git a/Example Apps/iOS SwiftUI Example/Info.plist b/Example Apps/iOS SwiftUI Example/Info.plist deleted file mode 100644 index efc211a0..00000000 --- a/Example Apps/iOS SwiftUI Example/Info.plist +++ /dev/null @@ -1,50 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UIApplicationSceneManifest - - UIApplicationSupportsMultipleScenes - - - UIApplicationSupportsIndirectInputEvents - - UILaunchScreen - - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/Example Apps/iOS SwiftUI Example/Root.swift b/Example Apps/iOS SwiftUI Example/Root.swift deleted file mode 100644 index 695be7dd..00000000 --- a/Example Apps/iOS SwiftUI Example/Root.swift +++ /dev/null @@ -1,10 +0,0 @@ -import SwiftUI - -@main -struct iOS_SwiftUI_ExampleApp: App { - var body: some Scene { - WindowGroup { - ContentView() - } - } -} diff --git a/Example Apps/tvOS Example/App/AppDelegate.swift b/Example Apps/tvOS Example/App/AppDelegate.swift deleted file mode 100644 index 4748a470..00000000 --- a/Example Apps/tvOS Example/App/AppDelegate.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 -import SparrowKit - -@UIApplicationMain -class AppDelegate: SPAppWindowDelegate { - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - let rootController = RootController().wrapToNavigationController(prefersLargeTitles: true) - makeKeyAndVisible(viewController: rootController, tint: .systemBlue) - return true - } -} diff --git a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json deleted file mode 100644 index 48ecb4fa..00000000 --- a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "images" : [ - { - "idiom" : "tv" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json b/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json deleted file mode 100644 index da4a164c..00000000 --- a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Contents.json b/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Contents.json deleted file mode 100644 index d29f024e..00000000 --- a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Contents.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "layers" : [ - { - "filename" : "Front.imagestacklayer" - }, - { - "filename" : "Middle.imagestacklayer" - }, - { - "filename" : "Back.imagestacklayer" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json deleted file mode 100644 index 48ecb4fa..00000000 --- a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "images" : [ - { - "idiom" : "tv" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json b/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json deleted file mode 100644 index da4a164c..00000000 --- a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json b/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json deleted file mode 100644 index 48ecb4fa..00000000 --- a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "images" : [ - { - "idiom" : "tv" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Contents.json b/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Contents.json deleted file mode 100644 index da4a164c..00000000 --- a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json deleted file mode 100644 index 16a370df..00000000 --- a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "images" : [ - { - "idiom" : "tv", - "scale" : "1x" - }, - { - "idiom" : "tv", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json b/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json deleted file mode 100644 index da4a164c..00000000 --- a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Contents.json b/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Contents.json deleted file mode 100644 index d29f024e..00000000 --- a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Contents.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "layers" : [ - { - "filename" : "Front.imagestacklayer" - }, - { - "filename" : "Middle.imagestacklayer" - }, - { - "filename" : "Back.imagestacklayer" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json deleted file mode 100644 index 16a370df..00000000 --- a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "images" : [ - { - "idiom" : "tv", - "scale" : "1x" - }, - { - "idiom" : "tv", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json b/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json deleted file mode 100644 index da4a164c..00000000 --- a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json b/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json deleted file mode 100644 index 16a370df..00000000 --- a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "images" : [ - { - "idiom" : "tv", - "scale" : "1x" - }, - { - "idiom" : "tv", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Middle.imagestacklayer/Contents.json b/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Middle.imagestacklayer/Contents.json deleted file mode 100644 index da4a164c..00000000 --- a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Middle.imagestacklayer/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/Contents.json b/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/Contents.json deleted file mode 100644 index db288f36..00000000 --- a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/Contents.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "assets" : [ - { - "size" : "1280x768", - "idiom" : "tv", - "filename" : "App Icon - App Store.imagestack", - "role" : "primary-app-icon" - }, - { - "size" : "400x240", - "idiom" : "tv", - "filename" : "App Icon.imagestack", - "role" : "primary-app-icon" - }, - { - "size" : "2320x720", - "idiom" : "tv", - "filename" : "Top Shelf Image Wide.imageset", - "role" : "top-shelf-image-wide" - }, - { - "size" : "1920x720", - "idiom" : "tv", - "filename" : "Top Shelf Image.imageset", - "role" : "top-shelf-image" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image Wide.imageset/Contents.json b/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image Wide.imageset/Contents.json deleted file mode 100644 index 16a370df..00000000 --- a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image Wide.imageset/Contents.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "images" : [ - { - "idiom" : "tv", - "scale" : "1x" - }, - { - "idiom" : "tv", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image.imageset/Contents.json b/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image.imageset/Contents.json deleted file mode 100644 index 16a370df..00000000 --- a/Example Apps/tvOS Example/App/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image.imageset/Contents.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "images" : [ - { - "idiom" : "tv", - "scale" : "1x" - }, - { - "idiom" : "tv", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Example Apps/tvOS Example/App/Assets.xcassets/Contents.json b/Example Apps/tvOS Example/App/Assets.xcassets/Contents.json deleted file mode 100644 index da4a164c..00000000 --- a/Example Apps/tvOS Example/App/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Example Apps/tvOS Example/App/LaunchScreen.storyboard b/Example Apps/tvOS Example/App/LaunchScreen.storyboard deleted file mode 100644 index 660ba53d..00000000 --- a/Example Apps/tvOS Example/App/LaunchScreen.storyboard +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Example Apps/tvOS Example/Info.plist b/Example Apps/tvOS Example/Info.plist deleted file mode 100644 index d89c4f1f..00000000 --- a/Example Apps/tvOS Example/Info.plist +++ /dev/null @@ -1,48 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - NSBluetoothAlwaysUsageDescription - Example Description - NSBluetoothPeripheralUsageDescription - Example Description - NSLocationAlwaysAndWhenInUseUsageDescription - Example Description - NSLocationAlwaysUsageDescription - Example Description - NSLocationUsageDescription - Example Description - NSLocationWhenInUseUsageDescription - Example Description - NSPhotoLibraryUsageDescription - Example Description - NSUserTrackingUsageDescription - Example Description - UILaunchStoryboardName - LaunchScreen - UIRequiredDeviceCapabilities - - arm64 - - UIUserInterfaceStyle - Automatic - - diff --git a/Example Apps/tvOS Example/Scenes/RootController.swift b/Example Apps/tvOS Example/Scenes/RootController.swift deleted file mode 100644 index 1f45c66e..00000000 --- a/Example Apps/tvOS Example/Scenes/RootController.swift +++ /dev/null @@ -1,112 +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 -import SparrowKit - -import PermissionsKit -import CameraPermission -import PhotoLibraryPermission -import NotificationPermission -import MicrophonePermission -import CalendarPermission -import ContactsPermission -import RemindersPermission -import SpeechRecognizerPermission -import LocationWhenInUsePermission -import LocationAlwaysPermission -import MotionPermission -import MediaLibraryPermission -import BluetoothPermission -import TrackingPermission - -class RootController: SPTableViewController { - - var availablePermissions: [Permission] = [.photoLibrary, .notification, .locationWhenInUse, .bluetooth, /*.tracking*/] - - var selectedPermissions: [Permission] = [] - - // MARK: Lifecycle - - override func viewDidLoad() { - super.viewDidLoad() - navigationItem.title = "Choose permissions" - navigationItem.rightBarButtonItem = UIBarButtonItem.init(barButtonSystemItem: .play, target: self, action: #selector(self.requestPermissions)) - tableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell") - } - - // MARK: Actions - - @objc func requestPermissions() { - let controller = PermissionsKit.native(selectedPermissions) - controller.delegate = self - controller.present(on: self) - } -} - -// MARK: - Permissions Data Source - -extension RootController: PermissionsDataSource { - - func deniedPermissionAlertTexts(for permission: Permission) -> DeniedPermissionAlertTexts? { - if permission.kind == .notification { - - // If returned nil, alert will not show. - - print("Alert for \(permission.debugName) not show, becouse in datasource returned nil. If you need alert, configure this.") - return nil - - } else { - - // You can create custom texts - - /* - let texts = DeniedPermissionAlertTexts() - texts.titleText = "Permission denied" - texts.descriptionText = "Please, go to Settings and allow permission." - texts.actionText = "Settings" - texts.cancelText = "Cancel" - return texts - */ - - // or use default texts. - - return .default - } - } -} - -// MARK: - Permissions Delegate - -extension RootController: PermissionsDelegate { - - func didHidePermissions(_ permissions: [Permission]) { - print("Example App: did hide with permissions", permissions.map { $0.debugName }) - } - - func didAllowPermission(_ permission: Permission) { - print("Example App: did allow", permission.debugName) - } - - func didDeniedPermission(_ permission: Permission) { - print("Example App: did denied", permission.debugName) - } -} diff --git a/Example Apps/tvOS Example/Scenes/RootControllerExtension.swift b/Example Apps/tvOS Example/Scenes/RootControllerExtension.swift deleted file mode 100644 index 58ad44ca..00000000 --- a/Example Apps/tvOS Example/Scenes/RootControllerExtension.swift +++ /dev/null @@ -1,64 +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 - -// MARK: - Table Data Source & Delegate - -extension RootController { - - override func numberOfSections(in tableView: UITableView) -> Int { - return 1 - } - - override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return availablePermissions.count - } - - override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) - let permission = availablePermissions[indexPath.row] - cell.textLabel?.text = permission.localisedName - cell.accessoryType = selectedPermissions.contains(permission) ? .checkmark : .none - cell.selectionStyle = .none - return cell - } - - override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - let cell = tableView.cellForRow(at: indexPath) - let permission = availablePermissions[indexPath.row] - if selectedPermissions.contains(permission) { - cell?.accessoryType = .none - selectedPermissions = selectedPermissions.filter { $0 != permission } - } else { - cell?.accessoryType = .checkmark - selectedPermissions.append(permission) - } - } - - override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { - return "Choose permissions" - } - - override func tableView(_ tableView: UITableView, titleForFooterInSection section: Int) -> String? { - return "All need keys added. When you add `PermissionsKit` to your project, need add some keys in Info.plist. See Readme.md for details." - } -} diff --git a/LICENSE b/LICENSE index f61d0cc3..a0468ede 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 Ivan Vorobei +Copyright (c) 2022 Sparrow Code 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/PermissionsKit.podspec b/PermissionsKit.podspec index 5ae69595..e2df6254 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 } @@ -24,8 +24,7 @@ Pod::Spec.new do |s| } subspec.resource_bundles = { "PermissionsKit" => [ - "Sources/PermissionsKit/Resources/Localization/*.lproj/*.strings", - "Sources/PermissionsKit/Resources/Assets.xcassets", + "Sources/PermissionsKit/Resources/Localization/*.lproj/*.strings" ] } end diff --git a/README.md b/README.md index db4ff862..678511fd 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # PermissionsKit -> **It was called `SPPermissions`, what happen?** I put together a team that deals with open source and gave the library to the company. It is now under a universal clean name. It will help develop the library more actively, even when I can't do it myself. Now I am doing version 9 with more permissions and a new interface. Share with me your ideas. - -Universal API for querying the rarefaction and getting the current status `.authorized`, `.denied` & `.notDetermined`. Available three ready-use interfaces - list, dialog & native. Supports iPad, dark mode, and has ready localizations. +Universal API for request permission and get its statuses. Available `.authorized`, `.denied` & `.notDetermined`.

@@ -43,16 +41,11 @@ 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) -- [Ready-use Interface](#ready-use-interface) - - [List](#list) - - [Dialog](#dialog) - - [Native](#native) -- [DataSource](#datasource) - - [Denied alert](#denied-alert) -- [Delegate](#delegate) -- [Localizations](#localizations) +- [Usage](#request-permission) + - [Request Permission](#request-permission) + - [Status Permission](#status-permission) - [Keys in Info.plist](#keys-in-infoplist) + - [Localisations](#localisation) - [Apple Review](#apple-review) - [Apps Using](#apps-using) @@ -84,13 +77,17 @@ Ready to use on iOS 11+. Supports iOS, tvOS, and `SwiftUI`. ### Swift Package Manager -The [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies. +In Xcode go to `File` -> `Packages` -> `Update to Latest Package Versions` and insert url: + +``` +https://github.com/sparrowcode/PermissionsKit +``` -Once you have your Swift package set up, adding a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`. +or adding it to the `dependencies` value of your `Package.swift`: ```swift dependencies: [ - .package(url: "https://github.com/sparrowcode/PermissionsKit", .upToNextMajor(from: "8.0.0")) + .package(url: "https://github.com/sparrowcode/PermissionsKit", .upToNextMajor(from: "9.0.0")) ] ``` @@ -131,180 +128,29 @@ 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 } ``` -## Ready-use Interface - -`PermissionsKit` has three presentation styles: `Dialog`, `List`, and `Native`. Each interface has delegates and a data source. If you want see an example app, open `Example Apps/PermissionsKit.xcodeproj`. - -### List - - - -It's native `UITableViewController`. Use it when you have more than two permissions. An example of how it is used: +## Status Permission ```swift -let controller = PermissionsKit.list([.calendar, .camera, .contacts]) - -// Ovveride texts in controller -controller.titleText = "Title Text" -controller.headerText = "Header Text" -controller.footerText = "Footer Text" - -// Set `DataSource` or `Delegate` if need. -// By default using project texts and icons. -controller.dataSource = self -controller.delegate = self - -// If you want auto dismiss controler, -// when all permissions has any determinated state -// set dismiss mode `allPermissionsDeterminated`. -// By default dismiss controller happen only when all permission allowed. -controller.dismissCondition = .allPermissionsDeterminated - -// Always use this method for present -controller.present(on: self) -``` - -### Dialog - - - -This is a modal alert. I recommend using this alert style when you have less than three requested permissions. Usage example: - -```swift -let controller = PermissionsKit.dialog([.camera, .photoLibrary]) - -// Override texts in controller -controller.titleText = "Title Text" -controller.headerText = "Header Text" -controller.footerText = "Footer Text" - -// Set `DataSource` or `Delegate` if need. -// By default using project texts and icons. -controller.dataSource = self -controller.delegate = self - -// If you want auto dismiss controler, -// when all permissions has any determinated state -// set dismiss mode `allPermissionsDeterminated`. -// By default dismiss controller happen only when all permission allowed. -controller.dismissCondition = .allPermissionsDeterminated - -// Always use this method for present -controller.present(on: self) -``` - -### Native - - - -Request permissions with native `UIAlertController`. You can request many permissions at once: - -```swift -let controller = PermissionsKit.native([.calendar, .camera, .contacts]) - -// Set `Delegate` if need. -controller.delegate = self - -// Always use this method for request. -controller.present(on: self) -``` - -## DataSource - -For data source using protocol `PermissionsDataSource`. You can customize the permission cells and provide denied alert texts. - -```swift -extension Controller: PermissionsDataSource { - - func configure(_ cell: PermissionTableViewCell, for permission: Permission) { - - // Here you can customise cell, like texts or colors. - cell.permissionTitleLabel.text = "Title" - cell.permissionDescriptionLabel.text = "Description" - - // If you need change icon, choose one of this: - cell.permissionIconView.setPermissionType(.bluetooth) - cell.permissionIconView.setCustomImage(UIImage.init(named: "custom-name")) - cell.permissionIconView.setCustomView(YourView()) - } -} -``` - -### Denied alert - -If a permission is denied, you can provide an alert to the user with an option to open settings. An example of how you can customise the alert text: - -```swift -let texts = PermissionDeniedAlertTexts() -texts.titleText = "Permission denied" -texts.descriptionText = "Please, go to Settings and allow permission." -texts.actionText = "Settings" -texts.cancelText = "Cancel" -``` - -Next implement the following method and return: - -```swift -func deniedPermissionAlertTexts(for permission: Permission) -> PermissionDeniedAlertTexts? { - - // Custom texts: - return texts - - // or default texts: - // return .default -} -``` - -## Delegate - -To get `hidden`, `allowed` or `denied` events , set the delegate with protocol `PermissionsDelegate`: +import PermissionsKit +import NotificationPermission -```swift -extension Controller: PermissionsDelegate { - - func didHidePermissions(_ permissions: [Permission]) {} - func didAllowPermission(_ permission: Permission) {} - func didDeniedPermission(_ permission: Permission) {} -} +let authorized = Permission.notification.authorized ``` -## Localizations - -`PermissionsKit` has ready-to-use localizations for: - -- English `en` -- Arabic `ar` -- German `de` -- Spanish `es` -- French `fr` -- Polish `pl` -- Portuguese `pt` -- Ukrainian `uk` -- Russian `ru` -- Chinese Simplified Han `zh_Hans` -- Italian `it` -- Chinese Traditional `zh_Hant` -- Persian `fa` - -If you want to add more, please, create folder `[language_id].lproj` and make a pull request. If you want to use your custom strings, check the [DataSource](#datasource) section. - ## 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: +You need to add some keys to the `Info.plist` file with descriptions, per Apple's requirements. You can get a plist of keys for permissions as follows: ```swift let key = Permission.bluetooth.usageDescriptionKey @@ -312,7 +158,9 @@ let key = Permission.bluetooth.usageDescriptionKey Do not use the description as the name of the key. -If you use xliff localization export, keys will be created automatically. If you prefer to do the localization file manually, you need to create `InfoPlist.strings`, select languages on the right side menu, and add keys as keys in plist-file. See: +### Localisation + +If you use xliff localization export, keys will be create automatically. If you prefer do the localization file manually, you need to create `InfoPlist.strings`, select languages on the right side menu and add keys as keys in plist-file. See: ``` "NSCameraUsageDescription" = "Here description of usage camera"; @@ -340,6 +188,9 @@ Also changed the title for the button. Instead of `allow` now use `continue`. T - + +

+ +If you use a `PermissionsKit`, add your application via Pull Request. diff --git a/Sources/BluetoothPermission/BluetoothHandler.swift b/Sources/BluetoothPermission/BluetoothHandler.swift index 0d7ebad4..20c8d894 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 916e8247..2730a857 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 e0440863..cf5efc3b 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 c322c865..2c855464 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 6c159357..73597de9 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 2a12c32f..f2be1eb3 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 a845f160..deed07b3 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 e922a203..89740b2e 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 22e969fe..7c244a25 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 4dc88d73..db765f94 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 5008d5cb..6a0a6526 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 e7ef4c7d..effc7d51 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 a1b13207..4e511592 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 907f3526..50a02a99 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 c4739060..3d47a94e 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 360944cd..d2cb67ab 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 5b1dac7b..00000000 --- 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 index 73f9d077..9175c2ed 100644 --- a/Sources/PermissionsKit/Data/Text.swift +++ b/Sources/PermissionsKit/Data/Text.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 @@ -62,65 +62,6 @@ enum Texts { } } - 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 { diff --git a/Sources/PermissionsKit/Extensions/ArrayExtension.swift b/Sources/PermissionsKit/Extensions/ArrayExtension.swift deleted file mode 100644 index c7155d1c..00000000 --- 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 5b12d7c1..00000000 --- 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 590a9c2b..00000000 --- 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 ef69ca0f..00000000 --- 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 2cc9d21b..00000000 --- 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 59f7dd5e..00000000 --- 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 ee975e46..00000000 --- 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 732c3c18..00000000 --- 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 5550b630..00000000 --- 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 322ff25f..00000000 --- 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 1111d3e0..00000000 --- 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 5d60f6a4..00000000 --- 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 9571d7d3..00000000 --- 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 13b7d582..00000000 --- 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 f918a8fe..00000000 --- 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 ce092e1e..00000000 --- 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 98d17017..00000000 --- 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 5320355a..00000000 --- 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 5877a6d8..00000000 --- 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 29d8c5e0..00000000 --- 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 a543fc15..5dd28f2b 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 @@ -43,10 +43,6 @@ open class Permission: Equatable { return Texts.permission_name(for: kind) } - open var iconImage: UIImage { - return Images.permission_icon(for: kind) - } - /** PermissionsKit: Open settings page. For most permissions its app page in settings app. @@ -63,7 +59,7 @@ open class Permission: Equatable { } // MARK: Must Ovveride - + open var kind: Permission.Kind { preconditionFailure("This method must be overridden.") } @@ -76,20 +72,20 @@ open class Permission: Equatable { preconditionFailure("This method must be overridden.") } + open var canBePresentWithCustomInterface: Bool { + return true + } + // MARK: Internal public static func == (lhs: Permission, rhs: Permission) -> Bool { return lhs.kind == rhs.kind } - open var canBePresentWithCustomInterface: Bool { - return true - } - public init() {} // MARK: - Models - + @objc public enum Status: Int { case authorized diff --git a/Sources/PermissionsKit/PermissionsKit.swift b/Sources/PermissionsKit/PermissionsKit.swift deleted file mode 100644 index 21a9b025..00000000 --- a/Sources/PermissionsKit/PermissionsKit.swift +++ /dev/null @@ -1,67 +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 PermissionsKit { - - // MARK: - Present - - @available(iOSApplicationExtension, unavailable) - public static func native(_ permissions: [Permission]) -> PermissionsNativeController { - let controller = PermissionsNativeController(prepare(permissions)) - return controller - } - - #if os(iOS) - @available(iOSApplicationExtension, unavailable) - public static func list(_ permissions: [Permission]) -> PermissionsListController { - let controller = PermissionsListController(prepare(permissions)) - return controller - } - - - @available(iOSApplicationExtension, unavailable) - public static func dialog(_ permissions: [Permission]) -> PermissionsDialogController { - let controller = PermissionsDialogController(prepare(permissions)) - return controller - } - #endif - - // MARK: - Helpers - - static func prepare(_ permissions: [Permission]) -> [Permission] { - - for duplicate in permissions.duplicates { - console("Got duplicate permission \(duplicate.debugName), it will be filtered") - } - - for unvailable in permissions.filter({ !$0.canBePresentWithCustomInterface }) { - console("Permission \(unvailable.debugName) can't be present with custom interface. Use `Permission.NAME.request()` with requerid parametrs. Permission \(unvailable.debugName) will be filtered") - } - - return permissions.removedDuplicates().filter({ $0.canBePresentWithCustomInterface }) - } - - static func console( _ message: String) { - print("PermissionsKit: \(message).") - } -} diff --git a/Sources/PermissionsKit/Protocols/PermissionsControllerInterface.swift b/Sources/PermissionsKit/Protocols/PermissionsControllerInterface.swift deleted file mode 100644 index 47405a7d..00000000 --- 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 e905a269..00000000 --- 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 9ab6b302..00000000 --- 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 4d698222..00000000 --- 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 b9470312..00000000 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 73c00596..00000000 --- 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 58a160ae..00000000 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 97462ec8..00000000 --- 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 11196bbe..00000000 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 85f96f79..00000000 --- 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 0e96624f..00000000 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 b0a9f522..00000000 --- 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 be9d4cd1..00000000 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 5c5d3f16..00000000 --- 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 73c00596..00000000 --- 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 41ce4b27..00000000 --- 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 375effad..00000000 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 5963187f..00000000 --- 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 e82b72c7..00000000 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 acea0233..00000000 --- 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 a55609ed..00000000 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 97b04f9b..00000000 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 7dacf8e1..00000000 --- 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 a4d9d816..00000000 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 bbe70828..00000000 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 40604c7e..00000000 --- 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 80e8b7e3..00000000 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 1a9198bc..00000000 --- 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 a8c8e5de..00000000 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 7522eee4..00000000 --- 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 40bc0a0c..00000000 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 a9c80ce7..00000000 --- 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 973e2c91..00000000 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 df748bd1..00000000 --- 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 452d2c1a..00000000 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 b407ace6..00000000 --- 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 9b1b11b6..00000000 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 53d77a9f..00000000 --- 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 bc3e9b05..00000000 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 3e4d938d..00000000 --- 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 dfb301b9..00000000 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 59d8ae87..00000000 --- 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 ef1176c5..00000000 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 dccdd791..00000000 --- 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 54c222d7..00000000 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 4a5a3a5d..00000000 --- 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 96b56015..00000000 Binary files a/Sources/PermissionsKit/Resources/Assets.xcassets/Permissions/Tracking.imageset/Tracking.pdf and /dev/null differ diff --git a/Sources/PermissionsKit/Services/DelayService.swift b/Sources/PermissionsKit/Services/DelayService.swift deleted file mode 100644 index df8d151e..00000000 --- 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 af2f452f..00000000 --- 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 8e0a18ad..00000000 --- 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 197d72fd..00000000 --- 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 2e36bbfd..d1243c08 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 6f359968..bd04c4ef 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 7ffbb0aa..3b3ecfa4 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 1fc50973..85924f27 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 34283f5a..29acd813 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