Commit 58fb4895 authored by yuzheng's avatar yuzheng

一些小优化和bugfix,发布3.6.2

parent ac697d0c
...@@ -125,7 +125,7 @@ A:不要去拿PHImageFileURLKey,没用的,只有通过Photos框架才能 ...@@ -125,7 +125,7 @@ A:不要去拿PHImageFileURLKey,没用的,只有通过Photos框架才能
## 六. Release Notes 最近更新 ## 六. Release Notes 最近更新
3.6.1 新增allowEditVideo,单选视频时支持裁剪 3.6.2 新增allowEditVideo,单选视频时支持裁剪
3.6.0 修复iOS14下iCloud视频导出失败问题 3.6.0 修复iOS14下iCloud视频导出失败问题
**3.5.2 适配iPhone12系列设备** **3.5.2 适配iPhone12系列设备**
3.4.4 支持Dark Mode 3.4.4 支持Dark Mode
......
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = "TZImagePickerController" s.name = "TZImagePickerController"
s.version = "3.6.1" s.version = "3.6.2"
s.summary = "A clone of UIImagePickerController, support picking multiple photos、original photo and video" s.summary = "A clone of UIImagePickerController, support picking multiple photos、original photo and video"
s.homepage = "https://github.com/banchichen/TZImagePickerController" s.homepage = "https://github.com/banchichen/TZImagePickerController"
s.license = "MIT" s.license = "MIT"
s.author = { "banchichen" => "tanzhenios@foxmail.com" } s.author = { "banchichen" => "tanzhenios@foxmail.com" }
s.platform = :ios s.platform = :ios
s.ios.deployment_target = "8.0" s.ios.deployment_target = "8.0"
s.source = { :git => "https://github.com/banchichen/TZImagePickerController.git", :tag => "3.6.1" } s.source = { :git => "https://github.com/banchichen/TZImagePickerController.git", :tag => "3.6.2" }
s.requires_arc = true s.requires_arc = true
s.resources = "TZImagePickerController/TZImagePickerController/*.{png,bundle}" s.resources = "TZImagePickerController/TZImagePickerController/*.{png,bundle}"
s.source_files = "TZImagePickerController/TZImagePickerController/*.{h,m}" s.source_files = "TZImagePickerController/TZImagePickerController/*.{h,m}"
......
...@@ -823,7 +823,7 @@ ...@@ -823,7 +823,7 @@
INFOPLIST_FILE = TZImagePickerController/Info.plist; INFOPLIST_FILE = TZImagePickerController/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0; IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 3.6.1; MARKETING_VERSION = 3.6.2;
PRODUCT_BUNDLE_IDENTIFIER = tanzhenios2021.TZImagePickerController.www; PRODUCT_BUNDLE_IDENTIFIER = tanzhenios2021.TZImagePickerController.www;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE = "";
...@@ -847,7 +847,7 @@ ...@@ -847,7 +847,7 @@
INFOPLIST_FILE = TZImagePickerController/Info.plist; INFOPLIST_FILE = TZImagePickerController/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0; IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 3.6.1; MARKETING_VERSION = 3.6.2;
PRODUCT_BUNDLE_IDENTIFIER = tanzhenios2021.TZImagePickerController.www; PRODUCT_BUNDLE_IDENTIFIER = tanzhenios2021.TZImagePickerController.www;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE = "";
...@@ -934,7 +934,7 @@ ...@@ -934,7 +934,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0; IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 3.6.1; MARKETING_VERSION = 3.6.2;
OTHER_LDFLAGS = "-all_load"; OTHER_LDFLAGS = "-all_load";
PRODUCT_BUNDLE_IDENTIFIER = tanzhen.TZImagePickerControllerFramework; PRODUCT_BUNDLE_IDENTIFIER = tanzhen.TZImagePickerControllerFramework;
PRODUCT_NAME = TZImagePickerController; PRODUCT_NAME = TZImagePickerController;
...@@ -975,7 +975,7 @@ ...@@ -975,7 +975,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0; IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 3.6.1; MARKETING_VERSION = 3.6.2;
OTHER_LDFLAGS = "-all_load"; OTHER_LDFLAGS = "-all_load";
PRODUCT_BUNDLE_IDENTIFIER = tanzhen.TZImagePickerControllerFramework; PRODUCT_BUNDLE_IDENTIFIER = tanzhen.TZImagePickerControllerFramework;
PRODUCT_NAME = TZImagePickerController; PRODUCT_NAME = TZImagePickerController;
......
...@@ -735,6 +735,10 @@ static dispatch_once_t onceToken; ...@@ -735,6 +735,10 @@ static dispatch_once_t onceToken;
} }
} }
- (void)requestVideoOutputPathWithAsset:(PHAsset *)asset presetName:(NSString *)presetName success:(void (^)(NSString *outputPath))success failure:(void (^)(NSString *errorMessage, NSError *error))failure {
[self requestVideoOutputPathWithAsset:asset presetName:presetName timeRange:kCMTimeRangeZero success:success failure:failure];
}
- (void)requestVideoOutputPathWithAsset:(PHAsset *)asset presetName:(NSString *)presetName timeRange:(CMTimeRange)timeRange success:(void (^)(NSString *outputPath))success failure:(void (^)(NSString *errorMessage, NSError *error))failure { - (void)requestVideoOutputPathWithAsset:(PHAsset *)asset presetName:(NSString *)presetName timeRange:(CMTimeRange)timeRange success:(void (^)(NSString *outputPath))success failure:(void (^)(NSString *errorMessage, NSError *error))failure {
if (!presetName) { if (!presetName) {
presetName = AVAssetExportPresetMediumQuality; presetName = AVAssetExportPresetMediumQuality;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
// //
// Created by 谭真 on 15/12/24. // Created by 谭真 on 15/12/24.
// Copyright © 2015年 谭真. All rights reserved. // Copyright © 2015年 谭真. All rights reserved.
// version 3.6.1 - 2021.07.06 // version 3.6.2 - 2021.07.07
// 更多信息,请前往项目的github地址:https://github.com/banchichen/TZImagePickerController // 更多信息,请前往项目的github地址:https://github.com/banchichen/TZImagePickerController
/* /*
...@@ -356,6 +356,7 @@ ...@@ -356,6 +356,7 @@
+ (CGFloat)tz_statusBarHeight; + (CGFloat)tz_statusBarHeight;
// 获得Info.plist数据字典 // 获得Info.plist数据字典
+ (NSDictionary *)tz_getInfoDictionary; + (NSDictionary *)tz_getInfoDictionary;
+ (NSString *)tz_getAppName;
+ (BOOL)tz_isRightToLeftLayout; + (BOOL)tz_isRightToLeftLayout;
+ (void)configBarButtonItem:(UIBarButtonItem *)item tzImagePickerVc:(TZImagePickerController *)tzImagePickerVc; + (void)configBarButtonItem:(UIBarButtonItem *)item tzImagePickerVc:(TZImagePickerController *)tzImagePickerVc;
+ (BOOL)isICloudSyncError:(NSError *)error; + (BOOL)isICloudSyncError:(NSError *)error;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
// //
// Created by 谭真 on 15/12/24. // Created by 谭真 on 15/12/24.
// Copyright © 2015年 谭真. All rights reserved. // Copyright © 2015年 谭真. All rights reserved.
// version 3.6.1 - 2021.07.06 // version 3.6.2 - 2021.07.07
// 更多信息,请前往项目的github地址:https://github.com/banchichen/TZImagePickerController // 更多信息,请前往项目的github地址:https://github.com/banchichen/TZImagePickerController
#import "TZImagePickerController.h" #import "TZImagePickerController.h"
...@@ -188,10 +188,7 @@ ...@@ -188,10 +188,7 @@
_tipLabel.textColor = [UIColor blackColor]; _tipLabel.textColor = [UIColor blackColor];
_tipLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth; _tipLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth;
NSDictionary *infoDict = [TZCommonTools tz_getInfoDictionary]; NSString *appName = [TZCommonTools tz_getAppName];
NSString *appName = [infoDict valueForKey:@"CFBundleDisplayName"];
if (!appName) appName = [infoDict valueForKey:@"CFBundleName"];
if (!appName) appName = [infoDict valueForKey:@"CFBundleExecutable"];
NSString *tipText = [NSString stringWithFormat:[NSBundle tz_localizedStringForKey:@"Allow %@ to access your album in \"Settings -> Privacy -> Photos\""],appName]; NSString *tipText = [NSString stringWithFormat:[NSBundle tz_localizedStringForKey:@"Allow %@ to access your album in \"Settings -> Privacy -> Photos\""],appName];
_tipLabel.text = tipText; _tipLabel.text = tipText;
[self.view addSubview:_tipLabel]; [self.view addSubview:_tipLabel];
...@@ -959,6 +956,20 @@ ...@@ -959,6 +956,20 @@
return infoDict ? infoDict : @{}; return infoDict ? infoDict : @{};
} }
+ (NSString *)tz_getAppName {
NSDictionary *infoDict = [self tz_getInfoDictionary];
NSString *appName = [infoDict valueForKey:@"CFBundleDisplayName"];
if (!appName) appName = [infoDict valueForKey:@"CFBundleName"];
if (!appName) appName = [infoDict valueForKey:@"CFBundleExecutable"];
if (!appName) {
infoDict = [NSBundle mainBundle].infoDictionary;
appName = [infoDict valueForKey:@"CFBundleDisplayName"];
if (!appName) appName = [infoDict valueForKey:@"CFBundleName"];
if (!appName) appName = [infoDict valueForKey:@"CFBundleExecutable"];
}
return appName;
}
+ (BOOL)tz_isRightToLeftLayout { + (BOOL)tz_isRightToLeftLayout {
if (@available(iOS 9.0, *)) { if (@available(iOS 9.0, *)) {
if ([UIView userInterfaceLayoutDirectionForSemanticContentAttribute:UISemanticContentAttributeUnspecified] == UIUserInterfaceLayoutDirectionRightToLeft) { if ([UIView userInterfaceLayoutDirectionForSemanticContentAttribute:UISemanticContentAttributeUnspecified] == UIUserInterfaceLayoutDirectionRightToLeft) {
......
...@@ -716,11 +716,8 @@ static CGFloat itemMargin = 5; ...@@ -716,11 +716,8 @@ static CGFloat itemMargin = 5;
AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo]; AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
if ((authStatus == AVAuthorizationStatusRestricted || authStatus ==AVAuthorizationStatusDenied)) { if ((authStatus == AVAuthorizationStatusRestricted || authStatus ==AVAuthorizationStatusDenied)) {
NSDictionary *infoDict = [TZCommonTools tz_getInfoDictionary];
// 无权限 做一个友好的提示 // 无权限 做一个友好的提示
NSString *appName = [infoDict valueForKey:@"CFBundleDisplayName"]; NSString *appName = [TZCommonTools tz_getAppName];
if (!appName) appName = [infoDict valueForKey:@"CFBundleName"];
if (!appName) appName = [infoDict valueForKey:@"CFBundleExecutable"];
NSString *title = [NSBundle tz_localizedStringForKey:@"Can not use camera"]; NSString *title = [NSBundle tz_localizedStringForKey:@"Can not use camera"];
NSString *message = [NSString stringWithFormat:[NSBundle tz_localizedStringForKey:@"Please allow %@ to access your camera in \"Settings -> Privacy -> Camera\""],appName]; NSString *message = [NSString stringWithFormat:[NSBundle tz_localizedStringForKey:@"Please allow %@ to access your camera in \"Settings -> Privacy -> Camera\""],appName];
......
...@@ -583,7 +583,7 @@ ...@@ -583,7 +583,7 @@
_originalPhotoLabel.hidden = YES; _originalPhotoLabel.hidden = YES;
} else { } else {
_originalPhotoButton.hidden = NO; _originalPhotoButton.hidden = NO;
if (_isSelectOriginalPhoto) _originalPhotoLabel.hidden = NO; if (_isSelectOriginalPhoto) _originalPhotoLabel.hidden = NO;
} }
} }
...@@ -629,8 +629,10 @@ ...@@ -629,8 +629,10 @@
self->_doneButton.enabled = YES; self->_doneButton.enabled = YES;
} }
self->_selectButton.hidden = currentModel.iCloudFailed || !_tzImagePickerVc.showSelectBtn; self->_selectButton.hidden = currentModel.iCloudFailed || !_tzImagePickerVc.showSelectBtn;
self->_originalPhotoButton.hidden = currentModel.iCloudFailed; if (currentModel.iCloudFailed) {
self->_originalPhotoLabel.hidden = currentModel.iCloudFailed; self->_originalPhotoButton.hidden = YES;
self->_originalPhotoLabel.hidden = YES;
}
}); });
} }
......
...@@ -180,6 +180,7 @@ ...@@ -180,6 +180,7 @@
CGFloat doneButtonWidth = [_doneButton.currentTitle boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX) options:NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16]} context:nil].size.width; CGFloat doneButtonWidth = [_doneButton.currentTitle boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX) options:NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16]} context:nil].size.width;
_cancelButton.frame = CGRectMake(12, self.view.tz_height - toolBarHeight, 44, 44); _cancelButton.frame = CGRectMake(12, self.view.tz_height - toolBarHeight, 44, 44);
[_cancelButton sizeToFit]; [_cancelButton sizeToFit];
_cancelButton.tz_height = 44;
_doneButton.frame = CGRectMake(self.view.tz_width - doneButtonWidth - 12, self.view.tz_height - toolBarHeight, doneButtonWidth, 44); _doneButton.frame = CGRectMake(self.view.tz_width - doneButtonWidth - 12, self.view.tz_height - toolBarHeight, doneButtonWidth, 44);
_playButton.frame = CGRectMake(0, statusBarAndNaviBarHeight, self.view.tz_width, self.view.tz_height - statusBarAndNaviBarHeight - toolBarHeight); _playButton.frame = CGRectMake(0, statusBarAndNaviBarHeight, self.view.tz_width, self.view.tz_height - statusBarAndNaviBarHeight - toolBarHeight);
......
...@@ -179,6 +179,7 @@ ...@@ -179,6 +179,7 @@
if (tzImagePickerVc.allowEditVideo) { if (tzImagePickerVc.allowEditVideo) {
_editButton.frame = CGRectMake(12, 0, 44, 44); _editButton.frame = CGRectMake(12, 0, 44, 44);
[_editButton sizeToFit]; [_editButton sizeToFit];
_editButton.tz_height = 44;
} }
if (tzImagePickerVc.videoPreviewPageDidLayoutSubviewsBlock) { if (tzImagePickerVc.videoPreviewPageDidLayoutSubviewsBlock) {
tzImagePickerVc.videoPreviewPageDidLayoutSubviewsBlock(_playButton, _toolBar, _editButton, _doneButton); tzImagePickerVc.videoPreviewPageDidLayoutSubviewsBlock(_playButton, _toolBar, _editButton, _doneButton);
......
...@@ -201,7 +201,7 @@ ...@@ -201,7 +201,7 @@
} else { } else {
[self pushTZImagePickerController]; [self pushTZImagePickerController];
} }
} else if (_isAllowEditVideo) { // preview edited video / 预览编辑后的视频 } else if (_isAllowEditVideo && [_selectedAssets[indexPath.item] isKindOfClass:[NSURL class]]) { // preview edited video / 预览编辑后的视频
TZVideoEditedPreviewController *vc = [[TZVideoEditedPreviewController alloc] init]; TZVideoEditedPreviewController *vc = [[TZVideoEditedPreviewController alloc] init];
vc.videoURL = _selectedAssets[indexPath.item]; vc.videoURL = _selectedAssets[indexPath.item];
vc.modalPresentationStyle = UIModalPresentationFullScreen; vc.modalPresentationStyle = UIModalPresentationFullScreen;
......
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