File tree 2 files changed +61
-17
lines changed
2 files changed +61
-17
lines changed Original file line number Diff line number Diff line change 17
17
<img src =" https://badgen.net/badge/icon/apple?icon=apple&label " >
18
18
<img src =" https://img.shields.io/badge/language-swift-orange.svg " >
19
19
<img src =" https://img.shields.io/badge/xcode-14.2+-yellow.svg " >
20
- <img src =" https://img.shields.io/badge/macOS10 .13+-blue.svg " >
20
+ <img src =" https://img.shields.io/badge/macOS-10 .13+-blue.svg " >
21
21
<img src =" https://img.shields.io/badge/build-passing-brightgreen " >
22
22
<img src =" https://img.shields.io/github/languages/top/DevLiuSir/LCPermissionsKit?color=blueviolet " >
23
23
<img src =" https://img.shields.io/github/license/DevLiuSir/LCPermissionsKit.svg " >
@@ -47,14 +47,6 @@ Current implementation supports permissions for:
47
47
* [ Full Disk Access] ( #full-disk-access )
48
48
49
49
50
- ## Usage
51
-
52
- ``` swift
53
- LCPermissionsKit.shared .requestAuthorization (for : .fullDiskAccess ) { status in
54
- print (status)
55
- }
56
- ```
57
-
58
50
59
51
## Permission Type
60
52
@@ -70,6 +62,36 @@ public enum LCPermissionType: Int {
70
62
71
63
72
64
65
+ ## Usage
66
+
67
+
68
+ - Checking permission status
69
+
70
+ ``` swift
71
+ let status = LCPermissionsKit.shared .authorizationStatus (for : .fullDiskAccess )
72
+ switch status {
73
+ case .authorized :
74
+ print (" authorized" )
75
+ case .notDetermined :
76
+ print (" notDetermined" )
77
+ case .denied :
78
+ print (" denied" )
79
+ case .limited :
80
+ print (" limited" )
81
+ }
82
+ ```
83
+
84
+
85
+ - Request Permission
86
+
87
+ ``` swift
88
+ LCPermissionsKit.shared .requestAuthorization (for : .fullDiskAccess ) { status in
89
+ print (status)
90
+ }
91
+ ```
92
+
93
+
94
+
73
95
74
96
## Calendar
75
97
10.9+
Original file line number Diff line number Diff line change 17
17
<img src =" https://badgen.net/badge/icon/apple?icon=apple&label " >
18
18
<img src =" https://img.shields.io/badge/language-swift-orange.svg " >
19
19
<img src =" https://img.shields.io/badge/xcode-14.2+-yellow.svg " >
20
- <img src =" https://img.shields.io/badge/macOS10 .13+-blue.svg " >
20
+ <img src =" https://img.shields.io/badge/macOS-10 .13+-blue.svg " >
21
21
<img src =" https://img.shields.io/badge/build-passing-brightgreen " >
22
22
<img src =" https://img.shields.io/github/languages/top/DevLiuSir/LCPermissionsKit?color=blueviolet " >
23
23
<img src =" https://img.shields.io/github/license/DevLiuSir/LCPermissionsKit.svg " >
46
46
* [ Full Disk Access] ( #full-disk-access )
47
47
48
48
49
- ## 使用
50
-
51
- ``` swift
52
- LCPermissionsKit.shared .requestAuthorization (for : .fullDiskAccess ) { status in
53
- print (status)
54
- }
55
- ```
56
49
57
50
58
51
## 权限类型
@@ -69,6 +62,35 @@ public enum LCPermissionType: Int {
69
62
70
63
71
64
65
+ ## 使用
66
+
67
+ - 检查权限状态
68
+
69
+ ``` swift
70
+ let status = LCPermissionsKit.shared .authorizationStatus (for : .fullDiskAccess )
71
+ switch status {
72
+ case .authorized :
73
+ print (" authorized" )
74
+ case .notDetermined :
75
+ print (" notDetermined" )
76
+ case .denied :
77
+ print (" denied" )
78
+ case .limited :
79
+ print (" limited" )
80
+ }
81
+ ```
82
+
83
+ - 请求权限
84
+
85
+ ``` swift
86
+ LCPermissionsKit.shared .requestAuthorization (for : .fullDiskAccess ) { status in
87
+ print (status)
88
+ }
89
+ ```
90
+
91
+
92
+
93
+
72
94
73
95
## 日历
74
96
10.9+
You can’t perform that action at this time.
0 commit comments