Commit 31f7566b authored by yuzheng.tz's avatar yuzheng.tz

修复allowPreview在单选模式下不生效的Bug;发布2.2.2版本

parent af22fc9a
......@@ -8,7 +8,7 @@
## 重要提示1:提issue前请先搜索,先从已有issue里找找线索。如果发现bug,请先和Demo对照自查下,如果Demo也有bug,请再提issue。Demo正常你那不正常的,提issue时请贴上你的初始化代码,注明必要的复现步骤。这样能避免多余的沟通,帮助你更快获取答案。
## 重要提示2:1.9.0版本后移除了"prefs:root="的调用,这个API已经被列为私有API,请大家尽快升级。目前最新版本2.2.1
## 重要提示2:1.9.0版本后移除了"prefs:root="的调用,这个API已经被列为私有API,请大家尽快升级。目前最新版本2.2.2
关于升级iOS10和Xcdoe8的提示:
在Xcode8环境下将项目运行在iOS10的设备/模拟器中,访问相册和相机需要额外配置info.plist文件。分别是Privacy - Photo Library Usage Description和Privacy - Camera Usage Description字段,详见Demo中info.plist中的设置。
......@@ -103,7 +103,7 @@ A:有QQ群:778723997
A:请先加QQ群和我确认下,避免同时改动同一处内容。**一个PR请只修复1个问题,变动内容越少越好**
最近更新
2.2.1 修复minPhotoWidthSelectable不生效的问题, 使用@available消除警告
2.2.2 修复minPhotoWidthSelectable不生效的问题, 使用@available消除警告
2.1.8 优化gif图播放的体验,加入iCloud同步进度条;新增notScaleImage属性,设置为YES时内部不去缩放图片
2.1.6 新增allowCameraLocation属性,默认为YES,置为NO时不会在照相/摄像时定位,修复一个序号紊乱的bug
2.1.5 修复开启showSelectedIndex后照片列表页iCloud图片进度条紊乱的bug
......
Pod::Spec.new do |s|
s.name = "TZImagePickerController"
s.version = "2.2.1"
s.version = "2.2.2"
s.summary = "A clone of UIImagePickerController, support picking multiple photos、original photo and video"
s.homepage = "https://github.com/banchichen/TZImagePickerController"
s.license = "MIT"
s.author = { "banchichen" => "tanzhenios@foxmail.com" }
s.platform = :ios
s.ios.deployment_target = "6.0"
s.source = { :git => "https://github.com/banchichen/TZImagePickerController.git", :tag => "2.2.1" }
s.source = { :git => "https://github.com/banchichen/TZImagePickerController.git", :tag => "2.2.2" }
s.requires_arc = true
s.resources = "TZImagePickerController/TZImagePickerController/*.{png,bundle}"
s.source_files = "TZImagePickerController/TZImagePickerController/*.{h,m}"
......
......@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.2.1</string>
<string>2.2.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
......
......@@ -19,6 +19,7 @@
@property (weak, nonatomic) UILabel *indexLabel;
@property (weak, nonatomic) UIView *bottomView;
@property (weak, nonatomic) UILabel *timeLength;
@property (strong, nonatomic) UITapGestureRecognizer *tapGesture;
@property (nonatomic, weak) UIImageView *videoImgView;
@property (nonatomic, strong) TZProgressView *progressView;
......@@ -134,6 +135,17 @@
}
}
- (void)setAllowPreview:(BOOL)allowPreview {
_allowPreview = allowPreview;
if (allowPreview) {
_imageView.userInteractionEnabled = NO;
_tapGesture.enabled = NO;
} else {
_imageView.userInteractionEnabled = YES;
_tapGesture.enabled = YES;
}
}
- (void)selectPhotoButtonClick:(UIButton *)sender {
if (self.didSelectPhotoBlock) {
self.didSelectPhotoBlock(sender.isSelected);
......@@ -150,6 +162,13 @@
}
}
/// 只在单选状态且allowPreview为NO时会有该事件
- (void)didTapImageView {
if (self.didSelectPhotoBlock) {
self.didSelectPhotoBlock(NO);
}
}
- (void)hideProgressView {
if (_progressView) {
self.progressView.hidden = YES;
......@@ -207,6 +226,9 @@
imageView.clipsToBounds = YES;
[self.contentView addSubview:imageView];
_imageView = imageView;
_tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapImageView)];
[_imageView addGestureRecognizer:_tapGesture];
}
return _imageView;
}
......
......@@ -4,7 +4,7 @@
//
// Created by 谭真 on 15/12/24.
// Copyright © 2015年 谭真. All rights reserved.
// version 2.2.1 - 2018.07.13
// version 2.2.2 - 2018.07.16
// 更多信息,请前往项目的github地址:https://github.com/banchichen/TZImagePickerController
/*
......
......@@ -4,7 +4,7 @@
//
// Created by 谭真 on 15/12/24.
// Copyright © 2015年 谭真. All rights reserved.
// version 2.2.1 - 2018.07.13
// version 2.2.2 - 2018.07.16
// 更多信息,请前往项目的github地址:https://github.com/banchichen/TZImagePickerController
#import "TZImagePickerController.h"
......
......@@ -541,6 +541,12 @@ static CGFloat itemMargin = 5;
} else {
// 2. select:check if over the maxImagesCount / 选择照片,检查是否超过了最大个数的限制
if (tzImagePickerVc.selectedModels.count < tzImagePickerVc.maxImagesCount) {
if (tzImagePickerVc.maxImagesCount == 1 && !tzImagePickerVc.allowPreview) {
model.isSelected = YES;
[tzImagePickerVc addSelectedModel:model];
[self doneButtonClick];
return;
}
strongCell.selectPhotoButton.selected = YES;
model.isSelected = YES;
if (tzImagePickerVc.showSelectedIndex || tzImagePickerVc.showPhotoCannotSelectLayer) {
......
......@@ -512,7 +512,7 @@
TZAssetModel *model = _models[_currentIndex];
_selectButton.selected = model.isSelected;
[self refreshSelectButtonImageViewContentMode];
if (_selectButton.isSelected && _tzImagePickerVc.showSelectedIndex) {
if (_selectButton.isSelected && _tzImagePickerVc.showSelectedIndex && _tzImagePickerVc.showSelectBtn) {
NSString *assetId = [[TZImageManager manager] getAssetIdentifier:model.asset];
NSString *index = [NSString stringWithFormat:@"%zd", [_tzImagePickerVc.selectedAssetIds indexOfObject:assetId] + 1];
_indexLabel.text = index;
......
......@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.2.1</string>
<string>2.2.2</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<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