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
83c5d16e
Commit
83c5d16e
authored
Apr 18, 2024
by
Steven杜宇
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 权限设置
parent
da4e0458
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 deletions
+24
-4
YHMyPermissionSettingVC.swift
.../Classes/Modules/Mine(我的)/C/YHMyPermissionSettingVC.swift
+24
-4
No files found.
galaxy/galaxy/Classes/Modules/Mine(我的)/C/YHMyPermissionSettingVC.swift
View file @
83c5d16e
...
...
@@ -68,17 +68,34 @@ class YHMyPermissionSettingVC: YHBaseViewController {
make
.
top
.
equalToSuperview
()
.
offset
(
k_Height_NavigationtBarAndStatuBar
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
k_Height_TabBar
)
}
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
updateNetWorkStatus
)
,
name
:
.
reachabilityChanged
,
object
:
nil
)
}
@objc
func
updateNetWorkStatus
()
{
for
item
in
items
{
if
item
.
type
==
.
network
{
DispatchQueue
.
main
.
async
{
item
.
enableStatus
=
YHNetworkStatusManager
.
shared
.
isNetWorkOK
self
.
tableView
.
reloadData
()
}
}
}
}
func
requestPermission
()
{
updateNetWorkStatus
()
// 获取相册权限
requestPhotoLibraryPermission
{
[
weak
self
]
grant
in
guard
let
self
=
self
else
{
return
}
for
item
in
items
{
if
item
.
type
==
.
photo
{
item
.
enableStatus
=
grant
self
.
tableView
.
reloadData
()
DispatchQueue
.
main
.
async
{
item
.
enableStatus
=
grant
self
.
tableView
.
reloadData
()
}
}
}
}
...
...
@@ -89,8 +106,10 @@ class YHMyPermissionSettingVC: YHBaseViewController {
guard
let
self
=
self
else
{
return
}
for
item
in
items
{
if
item
.
type
==
.
camera
{
item
.
enableStatus
=
grant
self
.
tableView
.
reloadData
()
DispatchQueue
.
main
.
async
{
item
.
enableStatus
=
grant
self
.
tableView
.
reloadData
()
}
}
}
}
...
...
@@ -167,6 +186,7 @@ extension YHMyPermissionSettingVC: UITableViewDelegate, UITableViewDataSource {
let
url
=
URL
(
string
:
UIApplication
.
openSettingsURLString
)
if
let
url
=
url
,
UIApplication
.
shared
.
canOpenURL
(
url
)
{
printLog
(
"settingUrl:
\(
url
)
"
)
UIApplication
.
shared
.
open
(
url
,
options
:
[:],
completionHandler
:
{
(
success
)
in
})
...
...
pete谢兆麟
@pete
mentioned in commit
550ea6ed
·
Apr 18, 2024
mentioned in commit
550ea6ed
mentioned in commit 550ea6edd759aa2d49ca313fff7e4fd6baed683d
Toggle commit list
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