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
3de0bb1b
Commit
3de0bb1b
authored
Jun 12, 2018
by
tanzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增allowCameraLocation属性,默认为YES,置为NO时不会在照相时定位
parent
6abe3e12
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
11 deletions
+15
-11
TZImagePickerController/TZImagePickerController/TZImagePickerController.h
...troller/TZImagePickerController/TZImagePickerController.h
+3
-2
TZImagePickerController/TZImagePickerController/TZImagePickerController.m
...troller/TZImagePickerController/TZImagePickerController.m
+1
-0
TZImagePickerController/TZImagePickerController/TZPhotoPickerController.m
...troller/TZImagePickerController/TZPhotoPickerController.m
+11
-9
No files found.
TZImagePickerController/TZImagePickerController/TZImagePickerController.h
View file @
3de0bb1b
...
...
@@ -87,11 +87,12 @@
/// Default is YES, if set NO, user can't picking image.
/// 默认为YES,如果设置为NO,用户将不能选择发送图片
@property
(
nonatomic
,
assign
)
BOOL
allowPickingImage
;
@property
(
nonatomic
,
assign
)
BOOL
allowPickingImage
;
/// Default is YES, if set NO, user can't take picture.
/// 默认为YES,如果设置为NO, 用户将不能拍摄照片
@property
(
nonatomic
,
assign
)
BOOL
allowTakePicture
;
@property
(
nonatomic
,
assign
)
BOOL
allowTakePicture
;
@property
(
nonatomic
,
assign
)
BOOL
allowCameraLocation
;
/// Default is YES, if set NO, user can't take video.
/// 默认为YES,如果设置为NO, 用户将不能拍摄视频
...
...
TZImagePickerController/TZImagePickerController/TZImagePickerController.m
View file @
3de0bb1b
...
...
@@ -273,6 +273,7 @@
self
.
allowPreview
=
YES
;
self
.
statusBarStyle
=
UIStatusBarStyleLightContent
;
self
.
cannotSelectLayerColor
=
[[
UIColor
whiteColor
]
colorWithAlphaComponent
:
0
.
8
];
self
.
allowCameraLocation
=
YES
;
self
.
iconThemeColor
=
[
UIColor
colorWithRed
:
31
/
255
.
0
green
:
185
/
255
.
0
blue
:
34
/
255
.
0
alpha
:
1
.
0
];
[
self
configDefaultBtnTitle
];
...
...
TZImagePickerController/TZImagePickerController/TZPhotoPickerController.m
View file @
3de0bb1b
...
...
@@ -650,18 +650,20 @@ static CGFloat itemMargin = 5;
// 调用相机
-
(
void
)
pushImagePickerController
{
// 提前定位
__weak
typeof
(
self
)
weakSelf
=
self
;
[[
TZLocationManager
manager
]
startLocationWithSuccessBlock
:
^
(
NSArray
<
CLLocation
*>
*
locations
)
{
__strong
typeof
(
weakSelf
)
strongSelf
=
weakSelf
;
strongSelf
.
location
=
[
locations
firstObject
];
}
failureBlock
:
^
(
NSError
*
error
)
{
__strong
typeof
(
weakSelf
)
strongSelf
=
weakSelf
;
strongSelf
.
location
=
nil
;
}];
TZImagePickerController
*
tzImagePickerVc
=
(
TZImagePickerController
*
)
self
.
navigationController
;
if
(
tzImagePickerVc
.
allowCameraLocation
)
{
__weak
typeof
(
self
)
weakSelf
=
self
;
[[
TZLocationManager
manager
]
startLocationWithSuccessBlock
:
^
(
NSArray
<
CLLocation
*>
*
locations
)
{
__strong
typeof
(
weakSelf
)
strongSelf
=
weakSelf
;
strongSelf
.
location
=
[
locations
firstObject
];
}
failureBlock
:
^
(
NSError
*
error
)
{
__strong
typeof
(
weakSelf
)
strongSelf
=
weakSelf
;
strongSelf
.
location
=
nil
;
}];
}
UIImagePickerControllerSourceType
sourceType
=
UIImagePickerControllerSourceTypeCamera
;
if
([
UIImagePickerController
isSourceTypeAvailable
:
sourceType
])
{
TZImagePickerController
*
tzImagePickerVc
=
(
TZImagePickerController
*
)
self
.
navigationController
;
self
.
imagePickerVc
.
sourceType
=
sourceType
;
NSMutableArray
*
mediaTypes
=
[
NSMutableArray
array
];
if
(
tzImagePickerVc
.
allowTakePicture
)
{
...
...
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