Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
f4088783
Commit
f4088783
authored
Apr 18, 2024
by
pete谢兆麟
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit '
1d098fd5
' into xiezhaolin
parents
fbab3ea7
1d098fd5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
YHMyPermissionSettingVC.swift
.../Classes/Modules/Mine(我的)/C/YHMyPermissionSettingVC.swift
+15
-4
No files found.
galaxy/galaxy/Classes/Modules/Mine(我的)/C/YHMyPermissionSettingVC.swift
View file @
f4088783
...
@@ -85,8 +85,10 @@ class YHMyPermissionSettingVC: YHBaseViewController {
...
@@ -85,8 +85,10 @@ class YHMyPermissionSettingVC: YHBaseViewController {
func
requestPermission
()
{
func
requestPermission
()
{
// 1)获取网络状态并更新
updateNetWorkStatus
()
updateNetWorkStatus
()
// 获取相册权限
// 2)获取相册权限
requestPhotoLibraryPermission
{
requestPhotoLibraryPermission
{
[
weak
self
]
grant
in
[
weak
self
]
grant
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
...
@@ -100,7 +102,7 @@ class YHMyPermissionSettingVC: YHBaseViewController {
...
@@ -100,7 +102,7 @@ class YHMyPermissionSettingVC: YHBaseViewController {
}
}
}
}
// 获取相机权限
//
3)
获取相机权限
requestCameraPermission
{
requestCameraPermission
{
[
weak
self
]
grant
in
[
weak
self
]
grant
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
...
@@ -129,7 +131,13 @@ class YHMyPermissionSettingVC: YHBaseViewController {
...
@@ -129,7 +131,13 @@ class YHMyPermissionSettingVC: YHBaseViewController {
case
.
notDetermined
:
case
.
notDetermined
:
// 尚未确定,请求授权
// 尚未确定,请求授权
completion
(
false
)
PHPhotoLibrary
.
requestAuthorization
{
authorizationStatus
in
self
.
requestPhotoLibraryPermission
{
granted
in
completion
(
granted
)
}
}
@unknown
default
:
@unknown
default
:
completion
(
false
)
completion
(
false
)
...
@@ -150,7 +158,10 @@ class YHMyPermissionSettingVC: YHBaseViewController {
...
@@ -150,7 +158,10 @@ class YHMyPermissionSettingVC: YHBaseViewController {
case
.
notDetermined
:
case
.
notDetermined
:
// 尚未确定,请求授权
// 尚未确定,请求授权
completion
(
false
)
AVCaptureDevice
.
requestAccess
(
for
:
.
video
)
{
granted
in
completion
(
granted
)
}
@unknown
default
:
@unknown
default
:
completion
(
false
)
completion
(
false
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment