Commit 3de0bb1b authored by tanzhen's avatar tanzhen

新增allowCameraLocation属性,默认为YES,置为NO时不会在照相时定位

parent 6abe3e12
...@@ -87,11 +87,12 @@ ...@@ -87,11 +87,12 @@
/// Default is YES, if set NO, user can't picking image. /// Default is YES, if set NO, user can't picking image.
/// 默认为YES,如果设置为NO,用户将不能选择发送图片 /// 默认为YES,如果设置为NO,用户将不能选择发送图片
@property(nonatomic, assign) BOOL allowPickingImage; @property (nonatomic, assign) BOOL allowPickingImage;
/// Default is YES, if set NO, user can't take picture. /// Default is YES, if set NO, user can't take picture.
/// 默认为YES,如果设置为NO, 用户将不能拍摄照片 /// 默认为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. /// Default is YES, if set NO, user can't take video.
/// 默认为YES,如果设置为NO, 用户将不能拍摄视频 /// 默认为YES,如果设置为NO, 用户将不能拍摄视频
......
...@@ -273,6 +273,7 @@ ...@@ -273,6 +273,7 @@
self.allowPreview = YES; self.allowPreview = YES;
self.statusBarStyle = UIStatusBarStyleLightContent; self.statusBarStyle = UIStatusBarStyleLightContent;
self.cannotSelectLayerColor = [[UIColor whiteColor] colorWithAlphaComponent:0.8]; 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.iconThemeColor = [UIColor colorWithRed:31 / 255.0 green:185 / 255.0 blue:34 / 255.0 alpha:1.0];
[self configDefaultBtnTitle]; [self configDefaultBtnTitle];
......
...@@ -650,6 +650,8 @@ static CGFloat itemMargin = 5; ...@@ -650,6 +650,8 @@ static CGFloat itemMargin = 5;
// 调用相机 // 调用相机
- (void)pushImagePickerController { - (void)pushImagePickerController {
// 提前定位 // 提前定位
TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
if (tzImagePickerVc.allowCameraLocation) {
__weak typeof(self) weakSelf = self; __weak typeof(self) weakSelf = self;
[[TZLocationManager manager] startLocationWithSuccessBlock:^(NSArray<CLLocation *> *locations) { [[TZLocationManager manager] startLocationWithSuccessBlock:^(NSArray<CLLocation *> *locations) {
__strong typeof(weakSelf) strongSelf = weakSelf; __strong typeof(weakSelf) strongSelf = weakSelf;
...@@ -658,10 +660,10 @@ static CGFloat itemMargin = 5; ...@@ -658,10 +660,10 @@ static CGFloat itemMargin = 5;
__strong typeof(weakSelf) strongSelf = weakSelf; __strong typeof(weakSelf) strongSelf = weakSelf;
strongSelf.location = nil; strongSelf.location = nil;
}]; }];
}
UIImagePickerControllerSourceType sourceType = UIImagePickerControllerSourceTypeCamera; UIImagePickerControllerSourceType sourceType = UIImagePickerControllerSourceTypeCamera;
if ([UIImagePickerController isSourceTypeAvailable: sourceType]) { if ([UIImagePickerController isSourceTypeAvailable: sourceType]) {
TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
self.imagePickerVc.sourceType = sourceType; self.imagePickerVc.sourceType = sourceType;
NSMutableArray *mediaTypes = [NSMutableArray array]; NSMutableArray *mediaTypes = [NSMutableArray array];
if (tzImagePickerVc.allowTakePicture) { if (tzImagePickerVc.allowTakePicture) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment