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
900d470d
Commit
900d470d
authored
Jun 19, 2020
by
翟书觅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iCloud无法同步逻辑优化
parent
11938e72
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
123 additions
and
51 deletions
+123
-51
TZImagePickerController.xcodeproj/project.pbxproj
TZImagePickerController.xcodeproj/project.pbxproj
+2
-2
TZImagePickerController/TZImagePickerController/TZAssetCell.m
...agePickerController/TZImagePickerController/TZAssetCell.m
+8
-4
TZImagePickerController/TZImagePickerController/TZAssetModel.h
...gePickerController/TZImagePickerController/TZAssetModel.h
+1
-1
TZImagePickerController/TZImagePickerController/TZPhotoPickerController.m
...troller/TZImagePickerController/TZPhotoPickerController.m
+8
-4
TZImagePickerController/TZImagePickerController/TZPhotoPreviewCell.h
...erController/TZImagePickerController/TZPhotoPreviewCell.h
+2
-0
TZImagePickerController/TZImagePickerController/TZPhotoPreviewCell.m
...erController/TZImagePickerController/TZPhotoPreviewCell.m
+29
-9
TZImagePickerController/TZImagePickerController/TZPhotoPreviewController.m
...roller/TZImagePickerController/TZPhotoPreviewController.m
+73
-31
No files found.
TZImagePickerController.xcodeproj/project.pbxproj
View file @
900d470d
...
@@ -488,7 +488,7 @@
...
@@ -488,7 +488,7 @@
900E657B1C2BB8D5003D9A9E
=
{
900E657B1C2BB8D5003D9A9E
=
{
CreatedOnToolsVersion
=
7.2
;
CreatedOnToolsVersion
=
7.2
;
DevelopmentTeam
=
LTFQDC2QVX
;
DevelopmentTeam
=
LTFQDC2QVX
;
ProvisioningStyle
=
Automatic
;
ProvisioningStyle
=
Automatic
;
};
};
900E65941C2BB8D5003D9A9E
=
{
900E65941C2BB8D5003D9A9E
=
{
CreatedOnToolsVersion
=
7.2
;
CreatedOnToolsVersion
=
7.2
;
...
@@ -823,7 +823,7 @@
...
@@ -823,7 +823,7 @@
CODE_SIGN_IDENTITY
=
""
;
CODE_SIGN_IDENTITY
=
""
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Developer"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Developer"
;
CODE_SIGN_STYLE
=
Automatic
;
CODE_SIGN_STYLE
=
Automatic
;
DEVELOPMENT_TEAM
=
LTFQDC2QVX
;
DEVELOPMENT_TEAM
=
""
;
FRAMEWORK_SEARCH_PATHS
=
(
FRAMEWORK_SEARCH_PATHS
=
(
"$(inherited)"
,
"$(inherited)"
,
"$(PROJECT_DIR)/TZImagePickerController"
,
"$(PROJECT_DIR)/TZImagePickerController"
,
...
...
TZImagePickerController/TZImagePickerController/TZAssetCell.m
View file @
900d470d
...
@@ -169,10 +169,14 @@
...
@@ -169,10 +169,14 @@
_bigImageRequestID
=
[[
TZImageManager
manager
]
requestImageDataForAsset
:
_model
.
asset
completion
:
^
(
NSData
*
imageData
,
NSString
*
dataUTI
,
UIImageOrientation
orientation
,
NSDictionary
*
info
)
{
_bigImageRequestID
=
[[
TZImageManager
manager
]
requestImageDataForAsset
:
_model
.
asset
completion
:
^
(
NSData
*
imageData
,
NSString
*
dataUTI
,
UIImageOrientation
orientation
,
NSDictionary
*
info
)
{
if
(
!
imageData
&&
[
info
[
PHImageResultIsInCloudKey
]
boolValue
])
{
if
(
!
imageData
&&
[
info
[
PHImageResultIsInCloudKey
]
boolValue
])
{
self
.
model
.
iCloudFaile
=
YES
;
if
(
self
.
model
.
type
==
TZAssetModelMediaTypeVideo
||
if
(
self
.
didSelectPhotoBlock
)
{
self
.
model
.
type
==
TZAssetCellTypePhotoGif
||
self
.
didSelectPhotoBlock
(
YES
);
self
.
model
.
type
==
TZAssetModelMediaTypeLivePhoto
)
{
self
.
selectImageView
.
image
=
self
.
photoDefImage
;
self
.
model
.
iCloudFailed
=
YES
;
if
(
self
.
didSelectPhotoBlock
)
{
self
.
didSelectPhotoBlock
(
YES
);
self
.
selectImageView
.
image
=
self
.
photoDefImage
;
}
}
}
}
}
[
self
hideProgressView
];
[
self
hideProgressView
];
...
...
TZImagePickerController/TZImagePickerController/TZAssetModel.h
View file @
900d470d
...
@@ -24,7 +24,7 @@ typedef enum : NSUInteger {
...
@@ -24,7 +24,7 @@ typedef enum : NSUInteger {
@property
(
nonatomic
,
assign
)
BOOL
isSelected
;
///< The select status of a photo, default is No
@property
(
nonatomic
,
assign
)
BOOL
isSelected
;
///< The select status of a photo, default is No
@property
(
nonatomic
,
assign
)
TZAssetModelMediaType
type
;
@property
(
nonatomic
,
assign
)
TZAssetModelMediaType
type
;
@property
(
nonatomic
,
copy
)
NSString
*
timeLength
;
@property
(
nonatomic
,
copy
)
NSString
*
timeLength
;
@property
(
nonatomic
,
assign
)
BOOL
iCloudFaile
;
@property
(
nonatomic
,
assign
)
BOOL
iCloudFaile
d
;
/// Init a photo dataModel With a PHAsset
/// Init a photo dataModel With a PHAsset
/// 用一个PHAsset实例,初始化一个照片模型
/// 用一个PHAsset实例,初始化一个照片模型
...
...
TZImagePickerController/TZImagePickerController/TZPhotoPickerController.m
View file @
900d470d
...
@@ -566,10 +566,14 @@ static CGFloat itemMargin = 5;
...
@@ -566,10 +566,14 @@ static CGFloat itemMargin = 5;
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
@"TZ_PHOTO_PICKER_RELOAD_NOTIFICATION"
object
:
strongSelf
.
navigationController
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
@"TZ_PHOTO_PICKER_RELOAD_NOTIFICATION"
object
:
strongSelf
.
navigationController
];
}
}
[
UIView
showOscillatoryAnimationWithLayer
:
strongLayer
type
:
TZOscillatoryAnimationToSmaller
];
[
UIView
showOscillatoryAnimationWithLayer
:
strongLayer
type
:
TZOscillatoryAnimationToSmaller
];
if
(
strongCell
.
model
.
iCloudFaile
)
{
if
(
strongCell
.
model
.
type
==
TZAssetModelMediaTypeLivePhoto
||
[
strongSelf
->
_models
replaceObjectAtIndex
:
indexPath
.
item
withObject
:
strongCell
.
model
];
strongCell
.
model
.
type
==
TZAssetModelMediaTypePhotoGif
||
NSString
*
title
=
[
NSBundle
tz_localizedStringForKey
:
@"iCloud sync failed"
];
strongCell
.
model
.
type
==
TZAssetModelMediaTypeVideo
)
{
[
tzImagePickerVc
showAlertWithTitle
:
title
];
if
(
strongCell
.
model
.
iCloudFailed
)
{
[
strongSelf
->
_models
replaceObjectAtIndex
:
indexPath
.
item
withObject
:
strongCell
.
model
];
NSString
*
title
=
[
NSBundle
tz_localizedStringForKey
:
@"iCloud sync failed"
];
[
tzImagePickerVc
showAlertWithTitle
:
title
];
}
}
}
}
else
{
}
else
{
// 2. select:check if over the maxImagesCount / 选择照片,检查是否超过了最大个数的限制
// 2. select:check if over the maxImagesCount / 选择照片,检查是否超过了最大个数的限制
...
...
TZImagePickerController/TZImagePickerController/TZPhotoPreviewCell.h
View file @
900d470d
...
@@ -40,6 +40,7 @@
...
@@ -40,6 +40,7 @@
@property
(
nonatomic
,
strong
)
TZProgressView
*
progressView
;
@property
(
nonatomic
,
strong
)
TZProgressView
*
progressView
;
@property
(
nonatomic
,
strong
)
UIImageView
*
icloudErrorIcon
;
@property
(
nonatomic
,
strong
)
UIImageView
*
icloudErrorIcon
;
@property
(
nonatomic
,
strong
)
UILabel
*
icloudErrorLB
;
@property
(
nonatomic
,
strong
)
UILabel
*
icloudErrorLB
;
@property
(
nonatomic
,
copy
)
void
(
^
iCloudSyncFailed
)(
id
asset
,
BOOL
isSyncFailed
);
@property
(
nonatomic
,
assign
)
BOOL
allowCrop
;
@property
(
nonatomic
,
assign
)
BOOL
allowCrop
;
...
@@ -65,6 +66,7 @@
...
@@ -65,6 +66,7 @@
@property
(
nonatomic
,
strong
)
NSURL
*
videoURL
;
@property
(
nonatomic
,
strong
)
NSURL
*
videoURL
;
@property
(
nonatomic
,
strong
)
UIImageView
*
icloudErrorIcon
;
@property
(
nonatomic
,
strong
)
UIImageView
*
icloudErrorIcon
;
@property
(
nonatomic
,
strong
)
UILabel
*
icloudErrorLB
;
@property
(
nonatomic
,
strong
)
UILabel
*
icloudErrorLB
;
@property
(
nonatomic
,
copy
)
void
(
^
iCloudSyncFailed
)(
id
asset
,
BOOL
isSyncFailed
);
-
(
void
)
pausePlayerAndShowNaviBar
;
-
(
void
)
pausePlayerAndShowNaviBar
;
@end
@end
...
...
TZImagePickerController/TZImagePickerController/TZPhotoPreviewCell.m
View file @
900d470d
...
@@ -67,6 +67,7 @@
...
@@ -67,6 +67,7 @@
-
(
void
)
setModel
:(
TZAssetModel
*
)
model
{
-
(
void
)
setModel
:(
TZAssetModel
*
)
model
{
[
super
setModel
:
model
];
[
super
setModel
:
model
];
_previewView
.
asset
=
model
.
asset
;
_previewView
.
asset
=
model
.
asset
;
_previewView
.
model
=
model
;
}
}
-
(
void
)
recoverSubviews
{
-
(
void
)
recoverSubviews
{
...
@@ -177,7 +178,12 @@
...
@@ -177,7 +178,12 @@
self
->
_icloudErrorLB
.
hidden
=
YES
;
self
->
_icloudErrorLB
.
hidden
=
YES
;
self
->
_icloudErrorIcon
.
hidden
=
YES
;
self
->
_icloudErrorIcon
.
hidden
=
YES
;
}
}
self
.
imageView
.
image
=
photo
;
if
(
self
.
iCloudSyncFailed
)
{
self
.
iCloudSyncFailed
(
model
.
asset
,
!
self
->
_icloudErrorLB
.
hidden
);
}
if
(
photo
)
{
self
.
imageView
.
image
=
photo
;
}
[
self
resizeSubviews
];
[
self
resizeSubviews
];
if
(
self
.
isRequestingGIF
)
{
if
(
self
.
isRequestingGIF
)
{
return
;
return
;
...
@@ -222,15 +228,24 @@
...
@@ -222,15 +228,24 @@
_asset
=
asset
;
_asset
=
asset
;
self
.
imageRequestID
=
[[
TZImageManager
manager
]
getPhotoWithAsset
:
asset
completion
:
^
(
UIImage
*
photo
,
NSDictionary
*
info
,
BOOL
isDegraded
)
{
self
.
imageRequestID
=
[[
TZImageManager
manager
]
getPhotoWithAsset
:
asset
completion
:
^
(
UIImage
*
photo
,
NSDictionary
*
info
,
BOOL
isDegraded
)
{
if
(
!
photo
&&
[
info
[
PHImageResultIsInCloudKey
]
boolValue
])
{
if
(
self
.
model
.
type
==
TZAssetModelMediaTypeVideo
||
self
->
_icloudErrorLB
.
hidden
=
NO
;
self
.
model
.
type
==
TZAssetModelMediaTypePhotoGif
||
self
->
_icloudErrorIcon
.
hidden
=
NO
;
self
.
model
.
type
==
TZAssetModelMediaTypeLivePhoto
)
{
}
else
{
if
(
!
photo
&&
[
info
[
PHImageResultIsInCloudKey
]
boolValue
])
{
self
->
_icloudErrorLB
.
hidden
=
YES
;
self
->
_icloudErrorLB
.
hidden
=
NO
;
self
->
_icloudErrorIcon
.
hidden
=
YES
;
self
->
_icloudErrorIcon
.
hidden
=
NO
;
}
else
{
self
->
_icloudErrorLB
.
hidden
=
YES
;
self
->
_icloudErrorIcon
.
hidden
=
YES
;
}
if
(
self
.
iCloudSyncFailed
)
{
self
.
iCloudSyncFailed
(
asset
,
!
self
->
_icloudErrorLB
.
hidden
);
}
}
}
if
(
!
[
asset
isEqual
:
self
->
_asset
])
return
;
if
(
!
[
asset
isEqual
:
self
->
_asset
])
return
;
self
.
imageView
.
image
=
photo
;
if
(
photo
)
{
self
.
imageView
.
image
=
photo
;
}
[
self
resizeSubviews
];
[
self
resizeSubviews
];
if
(
self
.
imageView
.
tz_height
&&
self
.
allowCrop
)
{
if
(
self
.
imageView
.
tz_height
&&
self
.
allowCrop
)
{
CGFloat
scale
=
MAX
(
self
.
cropRect
.
size
.
width
/
self
.
imageView
.
tz_width
,
self
.
cropRect
.
size
.
height
/
self
.
imageView
.
tz_height
);
CGFloat
scale
=
MAX
(
self
.
cropRect
.
size
.
width
/
self
.
imageView
.
tz_width
,
self
.
cropRect
.
size
.
height
/
self
.
imageView
.
tz_height
);
...
@@ -447,7 +462,12 @@
...
@@ -447,7 +462,12 @@
self
->
_icloudErrorLB
.
hidden
=
YES
;
self
->
_icloudErrorLB
.
hidden
=
YES
;
self
->
_icloudErrorIcon
.
hidden
=
YES
;
self
->
_icloudErrorIcon
.
hidden
=
YES
;
}
}
self
.
cover
=
photo
;
if
(
self
.
iCloudSyncFailed
)
{
self
.
iCloudSyncFailed
(
self
.
model
.
asset
,
!
self
->
_icloudErrorLB
.
hidden
);
}
if
(
photo
)
{
self
.
cover
=
photo
;
}
}];
}];
[[
TZImageManager
manager
]
getVideoWithAsset
:
self
.
model
.
asset
completion
:
^
(
AVPlayerItem
*
playerItem
,
NSDictionary
*
info
)
{
[[
TZImageManager
manager
]
getVideoWithAsset
:
self
.
model
.
asset
completion
:
^
(
AVPlayerItem
*
playerItem
,
NSDictionary
*
info
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
...
...
TZImagePickerController/TZImagePickerController/TZPhotoPreviewController.m
View file @
900d470d
...
@@ -459,8 +459,18 @@
...
@@ -459,8 +459,18 @@
__weak
typeof
(
self
)
weakSelf
=
self
;
__weak
typeof
(
self
)
weakSelf
=
self
;
if
(
_tzImagePickerVc
.
allowPickingMultipleVideo
&&
model
.
type
==
TZAssetModelMediaTypeVideo
)
{
if
(
_tzImagePickerVc
.
allowPickingMultipleVideo
&&
model
.
type
==
TZAssetModelMediaTypeVideo
)
{
cell
=
[
collectionView
dequeueReusableCellWithReuseIdentifier
:
@"TZVideoPreviewCell"
forIndexPath
:
indexPath
];
cell
=
[
collectionView
dequeueReusableCellWithReuseIdentifier
:
@"TZVideoPreviewCell"
forIndexPath
:
indexPath
];
TZVideoPreviewCell
*
currentCell
=
(
TZVideoPreviewCell
*
)
cell
;
currentCell
.
iCloudSyncFailed
=
^
(
id
asset
,
BOOL
isSyncFailed
)
{
model
.
iCloudFailed
=
isSyncFailed
;
[
weakSelf
.
models
replaceObjectAtIndex
:
indexPath
.
item
withObject
:
model
];
};
}
else
if
(
_tzImagePickerVc
.
allowPickingMultipleVideo
&&
model
.
type
==
TZAssetModelMediaTypePhotoGif
&&
_tzImagePickerVc
.
allowPickingGif
)
{
}
else
if
(
_tzImagePickerVc
.
allowPickingMultipleVideo
&&
model
.
type
==
TZAssetModelMediaTypePhotoGif
&&
_tzImagePickerVc
.
allowPickingGif
)
{
cell
=
[
collectionView
dequeueReusableCellWithReuseIdentifier
:
@"TZGifPreviewCell"
forIndexPath
:
indexPath
];
cell
=
[
collectionView
dequeueReusableCellWithReuseIdentifier
:
@"TZGifPreviewCell"
forIndexPath
:
indexPath
];
TZGifPreviewCell
*
currentCell
=
(
TZGifPreviewCell
*
)
cell
;
currentCell
.
previewView
.
iCloudSyncFailed
=
^
(
id
asset
,
BOOL
isSyncFailed
)
{
model
.
iCloudFailed
=
isSyncFailed
;
[
weakSelf
.
models
replaceObjectAtIndex
:
indexPath
.
item
withObject
:
model
];
};
}
else
{
}
else
{
cell
=
[
collectionView
dequeueReusableCellWithReuseIdentifier
:
@"TZPhotoPreviewCell"
forIndexPath
:
indexPath
];
cell
=
[
collectionView
dequeueReusableCellWithReuseIdentifier
:
@"TZPhotoPreviewCell"
forIndexPath
:
indexPath
];
TZPhotoPreviewCell
*
photoPreviewCell
=
(
TZPhotoPreviewCell
*
)
cell
;
TZPhotoPreviewCell
*
photoPreviewCell
=
(
TZPhotoPreviewCell
*
)
cell
;
...
@@ -485,6 +495,10 @@
...
@@ -485,6 +495,10 @@
}
}
}
}
}];
}];
photoPreviewCell
.
previewView
.
iCloudSyncFailed
=
^
(
id
asset
,
BOOL
isSyncFailed
)
{
model
.
iCloudFailed
=
isSyncFailed
;
[
weakSelf
.
models
replaceObjectAtIndex
:
indexPath
.
item
withObject
:
model
];
};
}
}
cell
.
model
=
model
;
cell
.
model
=
model
;
...
@@ -563,38 +577,12 @@
...
@@ -563,38 +577,12 @@
_originalPhotoLabel
.
hidden
=
YES
;
_originalPhotoLabel
.
hidden
=
YES
;
_doneButton
.
hidden
=
YES
;
_doneButton
.
hidden
=
YES
;
}
}
NSIndexPath
*
indexPath
=
[
NSIndexPath
indexPathForItem
:
self
.
currentIndex
inSection
:
0
];
// iCLoud同步失败的UI刷新
UICollectionViewCell
*
cell
=
[
_collectionView
cellForItemAtIndexPath
:
indexPath
];
if
(
model
.
type
==
TZAssetModelMediaTypePhotoGif
||
if
([
cell
isKindOfClass
:[
TZPhotoPreviewCell
class
]])
{
model
.
type
==
TZAssetModelMediaTypeLivePhoto
||
TZPhotoPreviewCell
*
currentCell
=
(
TZPhotoPreviewCell
*
)
cell
;
model
.
type
==
TZAssetModelMediaTypeVideo
)
{
if
(
_tzImagePickerVc
.
selectedModels
.
count
<=
0
)
{
[
self
refreshiCloudFailed
:
model
];
_doneButton
.
enabled
=
currentCell
.
previewView
.
icloudErrorLB
.
hidden
;
}
else
{
_doneButton
.
enabled
=
YES
;
}
_selectButton
.
hidden
=
!
currentCell
.
previewView
.
icloudErrorLB
.
hidden
;
}
else
if
([
cell
isKindOfClass
:[
TZVideoPreviewCell
class
]]){
TZVideoPreviewCell
*
currentCell
=
(
TZVideoPreviewCell
*
)
cell
;
if
(
_tzImagePickerVc
.
selectedModels
.
count
<=
0
)
{
_doneButton
.
enabled
=
currentCell
.
icloudErrorLB
.
hidden
;
}
else
{
_doneButton
.
enabled
=
YES
;
}
_selectButton
.
hidden
=
!
currentCell
.
icloudErrorLB
.
hidden
;
}
else
if
([
cell
isKindOfClass
:[
TZGifPreviewCell
class
]]){
TZGifPreviewCell
*
currentCell
=
(
TZGifPreviewCell
*
)
cell
;
if
(
_tzImagePickerVc
.
selectedModels
.
count
<=
0
)
{
_doneButton
.
enabled
=
currentCell
.
previewView
.
icloudErrorLB
.
hidden
;
}
else
{
_doneButton
.
enabled
=
YES
;
}
_selectButton
.
hidden
=
!
currentCell
.
previewView
.
icloudErrorLB
.
hidden
;
}
if
(
model
.
iCloudFaile
)
{
_selectButton
.
hidden
=
YES
;
_doneButton
.
enabled
=
NO
;
}
}
if
(
_tzImagePickerVc
.
photoPreviewPageDidRefreshStateBlock
)
{
if
(
_tzImagePickerVc
.
photoPreviewPageDidRefreshStateBlock
)
{
_tzImagePickerVc
.
photoPreviewPageDidRefreshStateBlock
(
_collectionView
,
_naviBar
,
_backButton
,
_selectButton
,
_indexLabel
,
_toolBar
,
_originalPhotoButton
,
_originalPhotoLabel
,
_doneButton
,
_numberImageView
,
_numberLabel
);
_tzImagePickerVc
.
photoPreviewPageDidRefreshStateBlock
(
_collectionView
,
_naviBar
,
_backButton
,
_selectButton
,
_indexLabel
,
_toolBar
,
_originalPhotoButton
,
_originalPhotoLabel
,
_doneButton
,
_numberImageView
,
_numberLabel
);
}
}
...
@@ -610,6 +598,60 @@
...
@@ -610,6 +598,60 @@
});
});
}
}
-
(
void
)
refreshiCloudFailed
:(
TZAssetModel
*
)
model
{
TZImagePickerController
*
_tzImagePickerVc
=
(
TZImagePickerController
*
)
self
.
navigationController
;
if
(
model
.
iCloudFailed
)
{
_selectButton
.
hidden
=
YES
;
_originalPhotoButton
.
hidden
=
YES
;
_originalPhotoLabel
.
hidden
=
YES
;
if
(
_tzImagePickerVc
.
selectedModels
.
count
<=
0
)
{
_doneButton
.
enabled
=
!
model
.
iCloudFailed
;
}
else
{
_doneButton
.
enabled
=
YES
;
}
}
else
{
NSIndexPath
*
indexPath
=
[
NSIndexPath
indexPathForItem
:
self
.
currentIndex
inSection
:
0
];
UICollectionViewCell
*
cell
=
[
_collectionView
cellForItemAtIndexPath
:
indexPath
];
if
([
cell
isKindOfClass
:[
TZPhotoPreviewCell
class
]])
{
TZPhotoPreviewCell
*
currentCell
=
(
TZPhotoPreviewCell
*
)
cell
;
currentCell
.
previewView
.
iCloudSyncFailed
=
^
(
id
asset
,
BOOL
isSyncFailed
)
{
if
([
asset
isEqual
:
model
.
asset
])
{
if
(
_tzImagePickerVc
.
selectedModels
.
count
<=
0
)
{
self
->
_doneButton
.
enabled
=
!
isSyncFailed
;
}
else
{
self
->
_doneButton
.
enabled
=
YES
;
}
self
->
_selectButton
.
hidden
=
isSyncFailed
;
}
};
}
else
if
([
cell
isKindOfClass
:[
TZVideoPreviewCell
class
]]){
TZVideoPreviewCell
*
currentCell
=
(
TZVideoPreviewCell
*
)
cell
;
currentCell
.
iCloudSyncFailed
=
^
(
id
asset
,
BOOL
isSyncFailed
)
{
if
([
asset
isEqual
:
model
.
asset
])
{
if
(
_tzImagePickerVc
.
selectedModels
.
count
<=
0
)
{
self
->
_doneButton
.
enabled
=
!
isSyncFailed
;
}
else
{
self
->
_doneButton
.
enabled
=
YES
;
}
self
->
_selectButton
.
hidden
=
isSyncFailed
;
}
};
}
else
if
([
cell
isKindOfClass
:[
TZGifPreviewCell
class
]]){
TZGifPreviewCell
*
currentCell
=
(
TZGifPreviewCell
*
)
cell
;
currentCell
.
previewView
.
iCloudSyncFailed
=
^
(
id
asset
,
BOOL
isSyncFailed
)
{
if
([
asset
isEqual
:
model
.
asset
])
{
if
(
_tzImagePickerVc
.
selectedModels
.
count
<=
0
)
{
self
->
_doneButton
.
enabled
=
!
isSyncFailed
;
}
else
{
self
->
_doneButton
.
enabled
=
YES
;
}
self
->
_selectButton
.
hidden
=
isSyncFailed
;
}
};
}
}
}
-
(
void
)
showPhotoBytes
{
-
(
void
)
showPhotoBytes
{
[[
TZImageManager
manager
]
getPhotosBytesWithArray
:@[
_models
[
self
.
currentIndex
]]
completion
:
^
(
NSString
*
totalBytes
)
{
[[
TZImageManager
manager
]
getPhotosBytesWithArray
:@[
_models
[
self
.
currentIndex
]]
completion
:
^
(
NSString
*
totalBytes
)
{
self
->
_originalPhotoLabel
.
text
=
[
NSString
stringWithFormat
:
@"(%@)"
,
totalBytes
];
self
->
_originalPhotoLabel
.
text
=
[
NSString
stringWithFormat
:
@"(%@)"
,
totalBytes
];
...
...
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