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
5fec573d
Commit
5fec573d
authored
Apr 01, 2017
by
yuzheng.tz
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/banchichen/TZImagePickerController
parents
cfa31a85
3e68ffd5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
TZImagePickerController/TZImagePickerController/TZImageManager.h
...PickerController/TZImagePickerController/TZImageManager.h
+1
-1
TZImagePickerController/TZImagePickerController/TZImageManager.m
...PickerController/TZImagePickerController/TZImageManager.m
+2
-2
TZImagePickerController/ViewController.m
TZImagePickerController/ViewController.m
+2
-2
No files found.
TZImagePickerController/TZImagePickerController/TZImageManager.h
View file @
5fec573d
...
...
@@ -39,7 +39,7 @@
/// Return YES if Authorized 返回YES如果得到了授权
-
(
BOOL
)
authorizationStatusAuthorized
;
-
(
NSInteger
)
authorizationStatus
;
+
(
NSInteger
)
authorizationStatus
;
/// Get Album 获得相册/相册数组
-
(
void
)
getCameraRollAlbum
:(
BOOL
)
allowPickingVideo
allowPickingImage
:(
BOOL
)
allowPickingImage
completion
:(
void
(
^
)(
TZAlbumModel
*
model
))
completion
;
...
...
TZImagePickerController/TZImagePickerController/TZImageManager.m
View file @
5fec573d
...
...
@@ -57,7 +57,7 @@ static CGFloat TZScreenScale;
/// Return YES if Authorized 返回YES如果得到了授权
-
(
BOOL
)
authorizationStatusAuthorized
{
NSInteger
status
=
[
self
authorizationStatus
];
NSInteger
status
=
[
self
.
class
authorizationStatus
];
if
(
status
==
0
)
{
/**
* 当某些情况下AuthorizationStatus == AuthorizationStatusNotDetermined时,无法弹出系统首次使用的授权alertView,系统应用设置里亦没有相册的设置,此时将无法使用,故作以下操作,弹出系统首次使用的授权alertView
...
...
@@ -68,7 +68,7 @@ static CGFloat TZScreenScale;
return
status
==
3
;
}
-
(
NSInteger
)
authorizationStatus
{
+
(
NSInteger
)
authorizationStatus
{
if
(
iOS8Later
)
{
return
[
PHPhotoLibrary
authorizationStatus
];
}
else
{
...
...
TZImagePickerController/ViewController.m
View file @
5fec573d
...
...
@@ -268,11 +268,11 @@
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"无法使用相机"
message
:
@"请在iPhone的""设置-隐私-相机""中允许访问相机"
delegate
:
self
cancelButtonTitle
:
@"取消"
otherButtonTitles
:
@"设置"
,
nil
];
[
alert
show
];
// 拍照之前还需要检查相册权限
}
else
if
([
[
TZImageManager
manager
]
authorizationStatus
]
==
2
)
{
// 已被拒绝,没有相册权限,将无法保存拍的照片
}
else
if
([
TZImageManager
authorizationStatus
]
==
2
)
{
// 已被拒绝,没有相册权限,将无法保存拍的照片
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"无法访问相册"
message
:
@"请在iPhone的""设置-隐私-相册""中允许访问相册"
delegate
:
self
cancelButtonTitle
:
@"取消"
otherButtonTitles
:
@"设置"
,
nil
];
alert
.
tag
=
1
;
[
alert
show
];
}
else
if
([
[
TZImageManager
manager
]
authorizationStatus
]
==
0
)
{
// 正在弹框询问用户是否允许访问相册,监听权限状态
}
else
if
([
TZImageManager
authorizationStatus
]
==
0
)
{
// 正在弹框询问用户是否允许访问相册,监听权限状态
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
0
.
1
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
return
[
self
takePhoto
];
});
...
...
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