Commit ce534e1f authored by yuzheng.tz's avatar yuzheng.tz

优化gif图播放的体验,加入iCloud同步进度条;发布2.1.7版本

parent 38e315eb
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
## 重要提示1:提issue前请先搜索,先从已有issue里找找线索。如果发现bug,请先和Demo对照自查下,如果Demo也有bug,请再提issue。Demo正常你那不正常的,提issue时请贴上你的初始化代码,注明必要的复现步骤。这样能避免多余的沟通,帮助你更快获取答案。 ## 重要提示1:提issue前请先搜索,先从已有issue里找找线索。如果发现bug,请先和Demo对照自查下,如果Demo也有bug,请再提issue。Demo正常你那不正常的,提issue时请贴上你的初始化代码,注明必要的复现步骤。这样能避免多余的沟通,帮助你更快获取答案。
## 重要提示2:1.9.0版本后移除了"prefs:root="的调用,这个API已经被列为私有API,请大家尽快升级。目前最新版本2.1.6 ## 重要提示2:1.9.0版本后移除了"prefs:root="的调用,这个API已经被列为私有API,请大家尽快升级。目前最新版本2.1.7
关于升级iOS10和Xcdoe8的提示: 关于升级iOS10和Xcdoe8的提示:
在Xcode8环境下将项目运行在iOS10的设备/模拟器中,访问相册和相机需要额外配置info.plist文件。分别是Privacy - Photo Library Usage Description和Privacy - Camera Usage Description字段,详见Demo中info.plist中的设置。 在Xcode8环境下将项目运行在iOS10的设备/模拟器中,访问相册和相机需要额外配置info.plist文件。分别是Privacy - Photo Library Usage Description和Privacy - Camera Usage Description字段,详见Demo中info.plist中的设置。
...@@ -97,6 +97,7 @@ A:1.8.4版本已支持 ...@@ -97,6 +97,7 @@ A:1.8.4版本已支持
A:考虑下,优先级低 A:考虑下,优先级低
最近更新 最近更新
2.1.7 优化gif图播放的体验,加入iCloud同步进度条;新增notScaleImage属性,设置为YES时内部不去缩放图片
2.1.6 新增allowCameraLocation属性,默认为YES,置为NO时不会在照相/摄像时定位,修复一个序号紊乱的bug 2.1.6 新增allowCameraLocation属性,默认为YES,置为NO时不会在照相/摄像时定位,修复一个序号紊乱的bug
2.1.5 修复开启showSelectedIndex后照片列表页iCloud图片进度条紊乱的bug 2.1.5 修复开启showSelectedIndex后照片列表页iCloud图片进度条紊乱的bug
2.1.4 新增多个页面和组件的样式自定义block,允许自定义绝大多数UI样式 2.1.4 新增多个页面和组件的样式自定义block,允许自定义绝大多数UI样式
......
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = "TZImagePickerController" s.name = "TZImagePickerController"
s.version = "2.1.6" s.version = "2.1.7"
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 = "6.0" s.ios.deployment_target = "6.0"
s.source = { :git => "https://github.com/banchichen/TZImagePickerController.git", :tag => "2.1.6" } s.source = { :git => "https://github.com/banchichen/TZImagePickerController.git", :tag => "2.1.7" }
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}"
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
90CE84AE1C3A89EF003D0779 /* TZImageManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 90CE84AD1C3A89EF003D0779 /* TZImageManager.m */; }; 90CE84AE1C3A89EF003D0779 /* TZImageManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 90CE84AD1C3A89EF003D0779 /* TZImageManager.m */; };
90CE84B71C3BABB6003D0779 /* TZVideoPlayerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 90CE84B61C3BABB6003D0779 /* TZVideoPlayerController.m */; }; 90CE84B71C3BABB6003D0779 /* TZVideoPlayerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 90CE84B61C3BABB6003D0779 /* TZVideoPlayerController.m */; };
90EBF5D61C2E298000CB9BCC /* UIView+Layout.m in Sources */ = {isa = PBXBuildFile; fileRef = 90EBF5D51C2E298000CB9BCC /* UIView+Layout.m */; }; 90EBF5D61C2E298000CB9BCC /* UIView+Layout.m in Sources */ = {isa = PBXBuildFile; fileRef = 90EBF5D51C2E298000CB9BCC /* UIView+Layout.m */; };
9F763A491FA071D000D9E526 /* TZImagePickerController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F763A421FA071CF00D9E526 /* TZImagePickerController.framework */; };
9F763A4A1FA071D000D9E526 /* TZImagePickerController.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9F763A421FA071CF00D9E526 /* TZImagePickerController.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 9F763A4A1FA071D000D9E526 /* TZImagePickerController.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9F763A421FA071CF00D9E526 /* TZImagePickerController.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
9F763A501FA072E500D9E526 /* TZImagePickerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 900EEFF71C2BBF9500EA709B /* TZImagePickerController.m */; }; 9F763A501FA072E500D9E526 /* TZImagePickerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 900EEFF71C2BBF9500EA709B /* TZImagePickerController.m */; };
9F763A521FA072E500D9E526 /* TZPhotoPickerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 900EEFFD1C2BD58B00EA709B /* TZPhotoPickerController.m */; }; 9F763A521FA072E500D9E526 /* TZPhotoPickerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 900EEFFD1C2BD58B00EA709B /* TZPhotoPickerController.m */; };
...@@ -171,7 +170,6 @@ ...@@ -171,7 +170,6 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
903996951F447609005E77C2 /* AssetsLibrary.framework in Frameworks */, 903996951F447609005E77C2 /* AssetsLibrary.framework in Frameworks */,
9F763A491FA071D000D9E526 /* TZImagePickerController.framework in Frameworks */,
903996931F447604005E77C2 /* Photos.framework in Frameworks */, 903996931F447604005E77C2 /* Photos.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>2.1.6</string> <string>2.1.7</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
......
...@@ -73,6 +73,7 @@ ...@@ -73,6 +73,7 @@
- (void)getOriginalPhotoWithAsset:(id)asset newCompletion:(void (^)(UIImage *photo,NSDictionary *info,BOOL isDegraded))completion; - (void)getOriginalPhotoWithAsset:(id)asset newCompletion:(void (^)(UIImage *photo,NSDictionary *info,BOOL isDegraded))completion;
// 该方法中,completion只会走一次 // 该方法中,completion只会走一次
- (void)getOriginalPhotoDataWithAsset:(id)asset completion:(void (^)(NSData *data,NSDictionary *info,BOOL isDegraded))completion; - (void)getOriginalPhotoDataWithAsset:(id)asset completion:(void (^)(NSData *data,NSDictionary *info,BOOL isDegraded))completion;
- (void)getOriginalPhotoDataWithAsset:(id)asset progressHandler:(void (^)(double progress, NSError *error, BOOL *stop, NSDictionary *info))progressHandler completion:(void (^)(NSData *data,NSDictionary *info,BOOL isDegraded))completion;
/// Save photo 保存照片 /// Save photo 保存照片
- (void)savePhotoWithImage:(UIImage *)image completion:(void (^)(NSError *error))completion; - (void)savePhotoWithImage:(UIImage *)image completion:(void (^)(NSError *error))completion;
......
...@@ -420,6 +420,9 @@ static dispatch_once_t onceToken; ...@@ -420,6 +420,9 @@ static dispatch_once_t onceToken;
PHImageRequestOptions *options = [[PHImageRequestOptions alloc] init]; PHImageRequestOptions *options = [[PHImageRequestOptions alloc] init];
options.resizeMode = PHImageRequestOptionsResizeModeFast; options.resizeMode = PHImageRequestOptionsResizeModeFast;
options.networkAccessAllowed = YES; options.networkAccessAllowed = YES;
if ([[model.asset valueForKey:@"filename"] hasSuffix:@"GIF"]) {
options.version = PHImageRequestOptionsVersionOriginal;
}
[[PHImageManager defaultManager] requestImageDataForAsset:model.asset options:options resultHandler:^(NSData *imageData, NSString *dataUTI, UIImageOrientation orientation, NSDictionary *info) { [[PHImageManager defaultManager] requestImageDataForAsset:model.asset options:options resultHandler:^(NSData *imageData, NSString *dataUTI, UIImageOrientation orientation, NSDictionary *info) {
if (model.type != TZAssetModelMediaTypeVideo) dataLength += imageData.length; if (model.type != TZAssetModelMediaTypeVideo) dataLength += imageData.length;
assetCount ++; assetCount ++;
...@@ -645,6 +648,10 @@ static dispatch_once_t onceToken; ...@@ -645,6 +648,10 @@ static dispatch_once_t onceToken;
} }
- (void)getOriginalPhotoDataWithAsset:(id)asset completion:(void (^)(NSData *data,NSDictionary *info,BOOL isDegraded))completion { - (void)getOriginalPhotoDataWithAsset:(id)asset completion:(void (^)(NSData *data,NSDictionary *info,BOOL isDegraded))completion {
[self getOriginalPhotoDataWithAsset:asset progressHandler:nil completion:completion];
}
- (void)getOriginalPhotoDataWithAsset:(id)asset progressHandler:(void (^)(double progress, NSError *error, BOOL *stop, NSDictionary *info))progressHandler completion:(void (^)(NSData *data,NSDictionary *info,BOOL isDegraded))completion {
if ([asset isKindOfClass:[PHAsset class]]) { if ([asset isKindOfClass:[PHAsset class]]) {
PHImageRequestOptions *option = [[PHImageRequestOptions alloc] init]; PHImageRequestOptions *option = [[PHImageRequestOptions alloc] init];
option.networkAccessAllowed = YES; option.networkAccessAllowed = YES;
...@@ -652,6 +659,7 @@ static dispatch_once_t onceToken; ...@@ -652,6 +659,7 @@ static dispatch_once_t onceToken;
// if version isn't PHImageRequestOptionsVersionOriginal, the gif may cann't play // if version isn't PHImageRequestOptionsVersionOriginal, the gif may cann't play
option.version = PHImageRequestOptionsVersionOriginal; option.version = PHImageRequestOptionsVersionOriginal;
} }
[option setProgressHandler:progressHandler];
option.deliveryMode = PHImageRequestOptionsDeliveryModeHighQualityFormat; option.deliveryMode = PHImageRequestOptionsDeliveryModeHighQualityFormat;
[[PHImageManager defaultManager] requestImageDataForAsset:asset options:option resultHandler:^(NSData *imageData, NSString *dataUTI, UIImageOrientation orientation, NSDictionary *info) { [[PHImageManager defaultManager] requestImageDataForAsset:asset options:option resultHandler:^(NSData *imageData, NSString *dataUTI, UIImageOrientation orientation, NSDictionary *info) {
BOOL downloadFinined = (![[info objectForKey:PHImageCancelledKey] boolValue] && ![info objectForKey:PHImageErrorKey]); BOOL downloadFinined = (![[info objectForKey:PHImageCancelledKey] boolValue] && ![info objectForKey:PHImageErrorKey]);
......
...@@ -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 2.1.6 - 2018.06.12 // version 2.1.7 - 2018.07.05
// 更多信息,请前往项目的github地址:https://github.com/banchichen/TZImagePickerController // 更多信息,请前往项目的github地址:https://github.com/banchichen/TZImagePickerController
/* /*
......
...@@ -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 2.1.6 - 2018.06.12 // version 2.1.7 - 2018.07.05
// 更多信息,请前往项目的github地址:https://github.com/banchichen/TZImagePickerController // 更多信息,请前往项目的github地址:https://github.com/banchichen/TZImagePickerController
#import "TZImagePickerController.h" #import "TZImagePickerController.h"
......
...@@ -156,12 +156,25 @@ ...@@ -156,12 +156,25 @@
self.imageView.image = photo; self.imageView.image = photo;
[self resizeSubviews]; [self resizeSubviews];
// 再显示gif动图 // 再显示gif动图
[[TZImageManager manager] getOriginalPhotoDataWithAsset:model.asset completion:^(NSData *data, NSDictionary *info, BOOL isDegraded) {
if (!isDegraded) { if (!isDegraded) {
[[TZImageManager manager] getOriginalPhotoDataWithAsset:model.asset progressHandler:^(double progress, NSError *error, BOOL *stop, NSDictionary *info) {
progress = progress > 0.02 ? progress : 0.02;
dispatch_async(dispatch_get_main_queue(), ^{
self.progressView.progress = progress;
if (progress >= 1) {
self.progressView.hidden = YES;
} else {
self.progressView.hidden = NO;
}
});
} completion:^(NSData *data, NSDictionary *info, BOOL isDegraded) {
if (!isDegraded) {
self.progressView.hidden = YES;
self.imageView.image = [UIImage sd_tz_animatedGIFWithData:data]; self.imageView.image = [UIImage sd_tz_animatedGIFWithData:data];
[self resizeSubviews]; [self resizeSubviews];
} }
}]; }];
}
} progressHandler:nil networkAccessAllowed:NO]; } progressHandler:nil networkAccessAllowed:NO];
} else { } else {
self.asset = model.asset; self.asset = model.asset;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>2.1.6</string> <string>2.1.7</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string> <string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key> <key>NSPrincipalClass</key>
......
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