Skip to content

Commit b73bd3e

Browse files
committed
WIP
1 parent f1eac8e commit b73bd3e

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

PAPermissions/Classes/PAPermissionsView.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public enum PAPermissionsType: String {
3636
case motionFitness = "motion fitness"
3737
case camera = "camera"
3838
case custom = "custom"
39+
case photoLibrary = "photo library"
3940
}
4041

4142
public class PAPermissionsItem {
@@ -65,6 +66,7 @@ public class PAPermissionsItem {
6566
case .reminders: key = Constants.InfoPlistKeys.reminders
6667
case .contacts: key = Constants.InfoPlistKeys.contacts
6768
case .motionFitness: key = Constants.InfoPlistKeys.motionFitness
69+
case .photoLibrary: key = Constants.InfoPlistKeys.photoLibrary
6870
case .location:
6971
if let _ = Bundle.main.object(forInfoDictionaryKey: Constants.InfoPlistKeys.locationAlways) {
7072
key = Constants.InfoPlistKeys.locationAlways
@@ -111,6 +113,8 @@ public class PAPermissionsItem {
111113
return PAPermissionsItem(type: type, identifier: type.rawValue, title: NSLocalizedString("Reminders", comment: ""), reason: localReason, icon: UIImage(named: "pa_reminders_icon", in: Bundle(for: PAPermissionsViewController.self), compatibleWith: nil)!)
112114
case .contacts:
113115
return PAPermissionsItem(type: type, identifier: type.rawValue, title: NSLocalizedString("Contacts", comment: ""), reason: localReason, icon: UIImage(named: "pa_contacts_icon", in: Bundle(for: PAPermissionsViewController.self), compatibleWith: nil)!)
116+
case .photoLibrary:
117+
return PAPermissionsItem(type: type, identifier: type.rawValue, title: NSLocalizedString("Photo Library", comment: ""), reason: localReason, icon: UIImage(named: "pa_contacts_icon", in: Bundle(for: PAPermissionsViewController.self), compatibleWith: nil)!)
114118
default:
115119
return nil
116120
}

PAPermissions/Classes/PAPermissionsViewController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public enum Constants {
1818
static let camera = "NSCameraUsageDescription"
1919
static let microphone = "NSMicrophoneUsageDescription"
2020
static let motionFitness = "NSMotionUsageDescription"
21+
static let photoLibrary = "NSPhotoLibraryUsageDescription"
2122
static let bluetooth = "NSBluetoothPeripheralUsageDescription"
2223
}
2324
}

0 commit comments

Comments
 (0)