Skip to content

Commit

Permalink
Added Health permission.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanvorobei committed Jun 6, 2021
1 parent c3d4c97 commit 082c61e
Show file tree
Hide file tree
Showing 31 changed files with 220 additions and 34 deletions.
Binary file modified Assets/Permissions/faceid.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Permissions/health.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Assets/Sketch/sppermissions-v6.sketch
Binary file not shown.
3 changes: 2 additions & 1 deletion Example Apps/Dependencies/Package.swift
Expand Up @@ -43,7 +43,8 @@ let package = Package(
.product(name: "SPPermissionsBluetooth", package: "SPPermissions"),
.product(name: "SPPermissionsTracking", package: "SPPermissions"),
.product(name: "SPPermissionsFaceID", package: "SPPermissions"),
.product(name: "SPPermissionsSiri", package: "SPPermissions")
.product(name: "SPPermissionsSiri", package: "SPPermissions"),
.product(name: "SPPermissionsHealth", package: "SPPermissions")
]
),
]
Expand Down
Binary file not shown.
3 changes: 2 additions & 1 deletion Example Apps/iOS Example/Scenes/RootController.swift
Expand Up @@ -39,10 +39,11 @@ import SPPermissionsBluetooth
import SPPermissionsTracking
import SPPermissionsFaceID
import SPPermissionsSiri
import SPPermissionsHealth

class RootController: SPTableViewController {

var availablePermissions: [SPPermissions.Permission] = [.camera, .photoLibrary, .notification, .microphone, .calendar, .contacts, .reminders, .speech, .locationWhenInUse, .locationAlways, .motion, .mediaLibrary, .bluetooth, /*.tracking,*/ .faceID, .siri]
var availablePermissions: [SPPermissions.Permission] = [.camera, .photoLibrary, .notification, .microphone, .calendar, .contacts, .reminders, .speech, .locationWhenInUse, .locationAlways, .motion, .mediaLibrary, .bluetooth, /*.tracking,*/ .faceID, .siri, .health]

var selectedPermissions: [SPPermissions.Permission] = []

Expand Down
12 changes: 12 additions & 0 deletions Package.swift
Expand Up @@ -75,6 +75,10 @@ let package = Package(
name: "SPPermissionsSiri",
targets: ["SPPermissionsSiri"]
),
.library(
name: "SPPermissionsHealth",
targets: ["SPPermissionsHealth"]
),
],
dependencies: [],
targets: [
Expand Down Expand Up @@ -214,6 +218,14 @@ let package = Package(
.define("SPPERMISSIONS_SIRI"),
.define("SPPERMISSIONS_SPM")
]
),
.target(
name: "SPPermissionsHealth",
dependencies: [.target(name: "SPPermissions")],
swiftSettings: [
.define("SPPERMISSIONS_HEALTH"),
.define("SPPERMISSIONS_SPM")
]
)
],
swiftLanguageVersions: [.v5]
Expand Down
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -26,6 +26,7 @@ If you like the project, don't forget to `put star ★` and follow me on GitHub:
<img src="https://github.com/ivanvorobei/SPPermissions/blob/main/Assets/Permissions/music.png" width="38">
<img src="https://github.com/ivanvorobei/SPPermissions/blob/main/Assets/Permissions/speech.png" width="38">
<img src="https://github.com/ivanvorobei/SPPermissions/blob/main/Assets/Permissions/bluetooth.png" width="38">
<img src="https://github.com/ivanvorobei/SPPermissions/blob/main/Assets/Permissions/health.png" width="38">
<img src="https://github.com/ivanvorobei/SPPermissions/blob/main/Assets/Permissions/tracking.png" width="38">
<img src="https://github.com/ivanvorobei/SPPermissions/blob/main/Assets/Permissions/faceid.png" width="38">
<img src="https://github.com/ivanvorobei/SPPermissions/blob/main/Assets/Permissions/siri.png" width="38">
Expand Down Expand Up @@ -139,6 +140,9 @@ pod 'SPPermissions/FaceID'
```ruby
pod 'SPPermissions/Siri'
```
```ruby
pod 'SPPermissions/Health'
```

</p>
</details>
Expand Down Expand Up @@ -371,6 +375,8 @@ List of keys:
- NSUserTrackingUsageDescription
- NSFaceIDUsageDescription
- NSSiriUsageDescription
- NSHealthUpdateUsageDescription
- NSHealthShareUsageDescription

Do not use the description as the name of the key.

Expand Down
23 changes: 15 additions & 8 deletions SPPermissions.podspec
@@ -1,13 +1,12 @@
Pod::Spec.new do |s|

s.name = "SPPermissions"
s.version = "6.4.7"
s.summary = "Ask permissions on Swift. Available List, Dialog & Native interface. Can check state permission."
s.homepage = "https://github.com/ivanvorobei/SPPermissions"
s.source = { :git => "https://github.com/ivanvorobei/SPPermissions.git", :tag => s.version }
s.license = { :type => "MIT", :file => "LICENSE" }

s.author = { "Ivan Vorobei" => "hello@ivanvorobei.by" }
s.name = "SPPermissions"
s.version = "6.4.8"
s.summary = "Ask permissions on Swift. Available List, Dialog & Native interface. Can check state permission."
s.homepage = "https://github.com/ivanvorobei/SPPermissions"
s.source = { :git => "https://github.com/ivanvorobei/SPPermissions.git", :tag => s.version }
s.license = { :type => "MIT", :file => "LICENSE" }
s.author = { "Ivan Vorobei" => "hello@ivanvorobei.by" }

s.requires_arc = true
s.ios.framework = 'UIKit'
Expand Down Expand Up @@ -150,5 +149,13 @@ Pod::Spec.new do |s|
"SWIFT_ACTIVE_COMPILATION_CONDITIONS" => "SPPERMISSIONS_SIRI SPPERMISSIONS_COCOAPODS"
}
end

s.subspec 'Health' do |subspec|
subspec.dependency 'SPPermissions/Core'
subspec.source_files = "Sources/SPPermissionsHealth/**/*.swift"
subspec.pod_target_xcconfig = {
"SWIFT_ACTIVE_COMPILATION_CONDITIONS" => "SPPERMISSIONS_HEALTH SPPERMISSIONS_COCOAPODS"
}
end

end
10 changes: 10 additions & 0 deletions Sources/SPPermissions/Extensions/ArrayExtension.swift
Expand Up @@ -23,6 +23,16 @@ 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 {
Expand Down
Expand Up @@ -79,7 +79,7 @@ public class SPPermissionsDrawIconView: UIView {
Draw.drawBluetooth(frame: rect, resizing: .aspectFit, color: tintColor)
case .tracking:
Draw.drawTracking(frame: rect, resizing: .aspectFit, color: tintColor)
case .faceID, .siri:
case .faceID, .siri, .health:
// Not implemented old style icons.
break
case .none:
Expand Down
Binary file not shown.
@@ -1,22 +1,15 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Health@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Health@3x.png",
"idiom" : "universal",
"scale" : "3x"
"filename" : "Health.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Expand Up @@ -74,6 +74,10 @@

"permission siri description" = "You will be able to use Siri";

"permission health name" = "Health";

"permission health description" = "Allow to access health data";

"denied alert title" = "طلب الاذن مرفوض";

"denied alert description" = "من فضلك ، انتقل إلى الإعدادات واسمح بالإذن.";
Expand Down
Expand Up @@ -74,6 +74,10 @@

"permission siri description" = "You will be able to use Siri";

"permission health name" = "Health";

"permission health description" = "Allow to access health data";

"denied alert title" = "Berechtigung verweigert";

"denied alert description" = "Bitte gehen Sie zu Einstellungen und erlauben Sie die Erlaubnis.";
Expand Down
Expand Up @@ -74,6 +74,10 @@

"permission siri description" = "You will be able to use Siri";

"permission health name" = "Health";

"permission health description" = "Allow to access health data";

"denied alert title" = "Permission denied";

"denied alert description" = "Please, go to Settings and allow permission.";
Expand Down
Expand Up @@ -75,6 +75,10 @@

"permission siri description" = "You will be able to use Siri";

"permission health name" = "Health";

"permission health description" = "Allow to access health data";

"denied alert title" = "Permiso denegado";

"denied alert description" = "Por favor, vaya a Configuración y permita el permiso.";
Expand Down
Expand Up @@ -74,6 +74,10 @@

"permission siri description" = "You will be able to use Siri";

"permission health name" = "Health";

"permission health description" = "Allow to access health data";

"denied alert title" = "Permission refusée";

"denied alert description" = "Veuillez aller dans Paramètres et autoriser la permission.";
Expand Down
Expand Up @@ -74,6 +74,10 @@

"permission siri description" = "You will be able to use Siri";

"permission health name" = "Health";

"permission health description" = "Allow to access health data";

"denied alert title" = "Odmowa pozwolenia";

"denied alert description" = "Proszę przejść do Ustawień i zezwolić na dostęp.";
Expand Down
Expand Up @@ -74,6 +74,10 @@

"permission siri description" = "You will be able to use Siri";

"permission health name" = "Health";

"permission health description" = "Allow to access health data";

"denied alert title" = "Permissão negada";

"denied alert description" = "Por favor, vá a Settings e permita a permissão.";
Expand Down
Expand Up @@ -76,6 +76,10 @@

"permission siri description" = "You will be able to use Siri";

"permission health name" = "Health";

"permission health description" = "Allow to access health data";

"denied alert description" = "Пожалуйста, перейдите в настройки и измените доступ к разрешению.";

"denied alert action" = "Открыть Настройки";
Expand Down
Expand Up @@ -76,6 +76,10 @@

"permission siri description" = "You will be able to use Siri";

"permission health name" = "Health";

"permission health description" = "Allow to access health data";

"denied alert description" = "Перейдіть у Налаштування та надайте дозвіл.";

"denied alert action" = "Налаштування";
Expand Down
Expand Up @@ -74,6 +74,10 @@

"permission siri description" = "You will be able to use Siri";

"permission health name" = "Health";

"permission health description" = "Allow to access health data";

"denied alert title" = "已拒绝授权";

"denied alert description" = "请跳转至设置并允许授权";
Expand Down

0 comments on commit 082c61e

Please sign in to comment.