Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
dz_TZImagePickerController
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shuijing
dz_TZImagePickerController
Commits
6861cf66
Commit
6861cf66
authored
Jan 24, 2017
by
Zhen Tan
Committed by
GitHub
Jan 24, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #353 from hsjcom/master
相册授权修改
parents
2ed793fa
318add53
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
1 deletion
+24
-1
TZImagePickerController/TZImagePickerController/TZImageManager.m
...PickerController/TZImagePickerController/TZImageManager.m
+24
-1
No files found.
TZImagePickerController/TZImagePickerController/TZImageManager.m
View file @
6861cf66
...
@@ -57,7 +57,15 @@ static CGFloat TZScreenScale;
...
@@ -57,7 +57,15 @@ static CGFloat TZScreenScale;
/// Return YES if Authorized 返回YES如果得到了授权
/// Return YES if Authorized 返回YES如果得到了授权
-
(
BOOL
)
authorizationStatusAuthorized
{
-
(
BOOL
)
authorizationStatusAuthorized
{
return
[
self
authorizationStatus
]
==
3
;
NSInteger
status
=
[
self
authorizationStatus
];
if
(
status
==
0
)
{
/**
* 当某些情况下AuthorizationStatus == AuthorizationStatusNotDetermined时,无法弹出系统首次使用的授权alertView,系统应用设置里亦没有相册的设置,此时将无法使用,故作以下操作,弹出系统首次使用的授权alertView
*/
[
self
requestAuthorizationWhenNotDetermined
];
}
return
status
==
3
;
}
}
-
(
NSInteger
)
authorizationStatus
{
-
(
NSInteger
)
authorizationStatus
{
...
@@ -69,6 +77,21 @@ static CGFloat TZScreenScale;
...
@@ -69,6 +77,21 @@ static CGFloat TZScreenScale;
return
NO
;
return
NO
;
}
}
//AuthorizationStatus == AuthorizationStatusNotDetermined 时询问授权弹出系统授权alertView
-
(
void
)
requestAuthorizationWhenNotDetermined
{
if
(
iOS8Later
)
{
dispatch_async
(
dispatch_get_global_queue
(
DISPATCH_QUEUE_PRIORITY_DEFAULT
,
0
),
^
{
[
PHPhotoLibrary
requestAuthorization
:
^
(
PHAuthorizationStatus
status
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
});
}];
});
}
else
{
[
self
.
assetLibrary
enumerateGroupsWithTypes
:
ALAssetsGroupAll
usingBlock
:
^
(
ALAssetsGroup
*
group
,
BOOL
*
stop
)
{
}
failureBlock
:
nil
];
}
}
#pragma mark - Get Album
#pragma mark - Get Album
/// Get Album 获得相册/相册数组
/// Get Album 获得相册/相册数组
...
...
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