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
7e9114aa
Commit
7e9114aa
authored
Jul 15, 2020
by
翟书觅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码规范命名和规范格式
parent
b2f67e49
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
82 deletions
+68
-82
TZImagePickerController/TZImagePickerController/TZAssetCell.m
...agePickerController/TZImagePickerController/TZAssetCell.m
+9
-7
TZImagePickerController/TZImagePickerController/TZPhotoPickerController.m
...troller/TZImagePickerController/TZPhotoPickerController.m
+5
-5
TZImagePickerController/TZImagePickerController/TZPhotoPreviewCell.h
...erController/TZImagePickerController/TZPhotoPreviewCell.h
+6
-6
TZImagePickerController/TZImagePickerController/TZPhotoPreviewCell.m
...erController/TZImagePickerController/TZPhotoPreviewCell.m
+45
-61
TZImagePickerController/TZImagePickerController/TZPhotoPreviewController.m
...roller/TZImagePickerController/TZPhotoPreviewController.m
+3
-3
No files found.
TZImagePickerController/TZImagePickerController/TZAssetCell.m
View file @
7e9114aa
...
@@ -194,13 +194,15 @@
...
@@ -194,13 +194,15 @@
}];
}];
if
(
_model
.
type
==
TZAssetCellTypeVideo
)
{
if
(
_model
.
type
==
TZAssetCellTypeVideo
)
{
[[
TZImageManager
manager
]
getVideoWithAsset
:
_model
.
asset
completion
:
^
(
AVPlayerItem
*
playerItem
,
NSDictionary
*
info
)
{
[[
TZImageManager
manager
]
getVideoWithAsset
:
_model
.
asset
completion
:
^
(
AVPlayerItem
*
playerItem
,
NSDictionary
*
info
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
if
(
!
playerItem
&&
[
info
[
PHImageResultIsInCloudKey
]
boolValue
])
{
self
->
_model
.
iCloudFailed
=
YES
;
dispatch_async
(
dispatch_get_main_queue
(),
^
{
if
(
self
->
_didSelectPhotoBlock
)
{
self
->
_model
.
iCloudFailed
=
YES
;
self
->
_didSelectPhotoBlock
(
YES
);
if
(
self
->
_didSelectPhotoBlock
)
{
self
->
_selectImageView
.
image
=
self
.
photoDefImage
;
self
->
_didSelectPhotoBlock
(
YES
);
}
self
->
_selectImageView
.
image
=
self
.
photoDefImage
;
});
}
});
}
}];
}];
}
}
}
}
...
...
TZImagePickerController/TZImagePickerController/TZPhotoPickerController.m
View file @
7e9114aa
...
@@ -566,11 +566,11 @@ static CGFloat itemMargin = 5;
...
@@ -566,11 +566,11 @@ 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
.
iCloudFailed
)
{
if
(
strongCell
.
model
.
iCloudFailed
)
{
[
strongSelf
->
_models
replaceObjectAtIndex
:
indexPath
.
item
withObject
:
strongCell
.
model
];
[
strongSelf
->
_models
replaceObjectAtIndex
:
indexPath
.
item
withObject
:
strongCell
.
model
];
NSString
*
title
=
[
NSBundle
tz_localizedStringForKey
:
@"iCloud sync failed"
];
NSString
*
title
=
[
NSBundle
tz_localizedStringForKey
:
@"iCloud sync failed"
];
[
tzImagePickerVc
showAlertWithTitle
:
title
];
[
tzImagePickerVc
showAlertWithTitle
:
title
];
}
}
}
else
{
}
else
{
// 2. select:check if over the maxImagesCount / 选择照片,检查是否超过了最大个数的限制
// 2. select:check if over the maxImagesCount / 选择照片,检查是否超过了最大个数的限制
if
(
tzImagePickerVc
.
selectedModels
.
count
<
tzImagePickerVc
.
maxImagesCount
)
{
if
(
tzImagePickerVc
.
selectedModels
.
count
<
tzImagePickerVc
.
maxImagesCount
)
{
...
...
TZImagePickerController/TZImagePickerController/TZPhotoPreviewCell.h
View file @
7e9114aa
...
@@ -38,9 +38,9 @@
...
@@ -38,9 +38,9 @@
@property
(
nonatomic
,
strong
)
UIScrollView
*
scrollView
;
@property
(
nonatomic
,
strong
)
UIScrollView
*
scrollView
;
@property
(
nonatomic
,
strong
)
UIView
*
imageContainerView
;
@property
(
nonatomic
,
strong
)
UIView
*
imageContainerView
;
@property
(
nonatomic
,
strong
)
TZProgressView
*
progressView
;
@property
(
nonatomic
,
strong
)
TZProgressView
*
progressView
;
@property
(
nonatomic
,
strong
)
UIImageView
*
i
c
loudErrorIcon
;
@property
(
nonatomic
,
strong
)
UIImageView
*
i
C
loudErrorIcon
;
@property
(
nonatomic
,
strong
)
UILabel
*
i
cloudErrorLB
;
@property
(
nonatomic
,
strong
)
UILabel
*
i
CloudErrorLabel
;
@property
(
nonatomic
,
copy
)
void
(
^
iCloudSyncFailed
)(
id
asset
,
BOOL
isSyncFailed
);
@property
(
nonatomic
,
copy
)
void
(
^
iCloudSyncFailed
Handle
)(
id
asset
,
BOOL
isSyncFailed
);
@property
(
nonatomic
,
assign
)
BOOL
allowCrop
;
@property
(
nonatomic
,
assign
)
BOOL
allowCrop
;
...
@@ -64,9 +64,9 @@
...
@@ -64,9 +64,9 @@
@property
(
strong
,
nonatomic
)
UIButton
*
playButton
;
@property
(
strong
,
nonatomic
)
UIButton
*
playButton
;
@property
(
strong
,
nonatomic
)
UIImage
*
cover
;
@property
(
strong
,
nonatomic
)
UIImage
*
cover
;
@property
(
nonatomic
,
strong
)
NSURL
*
videoURL
;
@property
(
nonatomic
,
strong
)
NSURL
*
videoURL
;
@property
(
nonatomic
,
strong
)
UIImageView
*
i
c
loudErrorIcon
;
@property
(
nonatomic
,
strong
)
UIImageView
*
i
C
loudErrorIcon
;
@property
(
nonatomic
,
strong
)
UILabel
*
i
cloudErrorLB
;
@property
(
nonatomic
,
strong
)
UILabel
*
i
CloudErrorLabel
;
@property
(
nonatomic
,
copy
)
void
(
^
iCloudSyncFailed
)(
id
asset
,
BOOL
isSyncFailed
);
@property
(
nonatomic
,
copy
)
void
(
^
iCloudSyncFailed
Handle
)(
id
asset
,
BOOL
isSyncFailed
);
-
(
void
)
pausePlayerAndShowNaviBar
;
-
(
void
)
pausePlayerAndShowNaviBar
;
@end
@end
...
...
TZImagePickerController/TZImagePickerController/TZPhotoPreviewCell.m
View file @
7e9114aa
...
@@ -135,16 +135,16 @@
...
@@ -135,16 +135,16 @@
_imageView
.
clipsToBounds
=
YES
;
_imageView
.
clipsToBounds
=
YES
;
[
_imageContainerView
addSubview
:
_imageView
];
[
_imageContainerView
addSubview
:
_imageView
];
_i
c
loudErrorIcon
=
[[
UIImageView
alloc
]
init
];
_i
C
loudErrorIcon
=
[[
UIImageView
alloc
]
init
];
_i
c
loudErrorIcon
.
image
=
[
UIImage
tz_imageNamedFromMyBundle
:
@"iCloudError"
];
_i
C
loudErrorIcon
.
image
=
[
UIImage
tz_imageNamedFromMyBundle
:
@"iCloudError"
];
_i
c
loudErrorIcon
.
hidden
=
YES
;
_i
C
loudErrorIcon
.
hidden
=
YES
;
[
self
addSubview
:
_i
c
loudErrorIcon
];
[
self
addSubview
:
_i
C
loudErrorIcon
];
_i
cloudErrorLB
=
[[
UILabel
alloc
]
init
];
_i
CloudErrorLabel
=
[[
UILabel
alloc
]
init
];
_i
cloudErrorLB
.
font
=
[
UIFont
systemFontOfSize
:
10
];
_i
CloudErrorLabel
.
font
=
[
UIFont
systemFontOfSize
:
10
];
_i
cloudErrorLB
.
textColor
=
[
UIColor
whiteColor
];
_i
CloudErrorLabel
.
textColor
=
[
UIColor
whiteColor
];
_i
cloudErrorLB
.
text
=
[
NSBundle
tz_localizedStringForKey
:
@"iCloud sync failed"
];
_i
CloudErrorLabel
.
text
=
[
NSBundle
tz_localizedStringForKey
:
@"iCloud sync failed"
];
_i
cloudErrorLB
.
hidden
=
YES
;
_i
CloudErrorLabel
.
hidden
=
YES
;
[
self
addSubview
:
_i
cloudErrorLB
];
[
self
addSubview
:
_i
CloudErrorLabel
];
UITapGestureRecognizer
*
tap1
=
[[
UITapGestureRecognizer
alloc
]
initWithTarget
:
self
action
:
@selector
(
singleTap
:
)];
UITapGestureRecognizer
*
tap1
=
[[
UITapGestureRecognizer
alloc
]
initWithTarget
:
self
action
:
@selector
(
singleTap
:
)];
[
self
addGestureRecognizer
:
tap1
];
[
self
addGestureRecognizer
:
tap1
];
...
@@ -171,15 +171,11 @@
...
@@ -171,15 +171,11 @@
if
(
model
.
type
==
TZAssetModelMediaTypePhotoGif
)
{
if
(
model
.
type
==
TZAssetModelMediaTypePhotoGif
)
{
// 先显示缩略图
// 先显示缩略图
[[
TZImageManager
manager
]
getPhotoWithAsset
:
model
.
asset
completion
:
^
(
UIImage
*
photo
,
NSDictionary
*
info
,
BOOL
isDegraded
)
{
[[
TZImageManager
manager
]
getPhotoWithAsset
:
model
.
asset
completion
:
^
(
UIImage
*
photo
,
NSDictionary
*
info
,
BOOL
isDegraded
)
{
if
(
!
photo
&&
[
info
[
PHImageResultIsInCloudKey
]
boolValue
])
{
BOOL
iCloudSyncFailed
=
!
photo
&&
[
info
[
PHImageResultIsInCloudKey
]
boolValue
];
self
->
_icloudErrorLB
.
hidden
=
NO
;
self
.
iCloudErrorLabel
.
hidden
=
!
iCloudSyncFailed
;
self
->
_icloudErrorIcon
.
hidden
=
NO
;
self
.
iCloudErrorIcon
.
hidden
=
!
iCloudSyncFailed
;
}
else
{
if
(
self
.
iCloudSyncFailedHandle
)
{
self
->
_icloudErrorLB
.
hidden
=
YES
;
self
.
iCloudSyncFailedHandle
(
model
.
asset
,
iCloudSyncFailed
);
self
->
_icloudErrorIcon
.
hidden
=
YES
;
}
if
(
self
.
iCloudSyncFailed
)
{
self
.
iCloudSyncFailed
(
model
.
asset
,
!
self
->
_icloudErrorLB
.
hidden
);
}
}
if
(
photo
)
{
if
(
photo
)
{
self
.
imageView
.
image
=
photo
;
self
.
imageView
.
image
=
photo
;
...
@@ -228,15 +224,11 @@
...
@@ -228,15 +224,11 @@
_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
])
{
BOOL
iCloudSyncFailed
=
!
photo
&&
[
info
[
PHImageResultIsInCloudKey
]
boolValue
];
self
->
_icloudErrorLB
.
hidden
=
NO
;
self
.
iCloudErrorLabel
.
hidden
=
!
iCloudSyncFailed
;
self
->
_icloudErrorIcon
.
hidden
=
NO
;
self
.
iCloudErrorIcon
.
hidden
=
!
iCloudSyncFailed
;
}
else
{
if
(
self
.
iCloudSyncFailedHandle
)
{
self
->
_icloudErrorLB
.
hidden
=
YES
;
self
.
iCloudSyncFailedHandle
(
asset
,
iCloudSyncFailed
);
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
;
if
(
photo
)
{
if
(
photo
)
{
...
@@ -252,7 +244,7 @@
...
@@ -252,7 +244,7 @@
[
self
.
scrollView
setZoomScale
:
scale
animated
:
YES
];
[
self
.
scrollView
setZoomScale
:
scale
animated
:
YES
];
}
}
}
}
self
->
_progressView
.
hidden
=
YES
;
self
->
_progressView
.
hidden
=
YES
;
if
(
self
.
imageProgressUpdateBlock
)
{
if
(
self
.
imageProgressUpdateBlock
)
{
self
.
imageProgressUpdateBlock
(
1
);
self
.
imageProgressUpdateBlock
(
1
);
...
@@ -350,8 +342,8 @@
...
@@ -350,8 +342,8 @@
CGFloat
progressY
=
(
self
.
tz_height
-
progressWH
)
/
2
;
CGFloat
progressY
=
(
self
.
tz_height
-
progressWH
)
/
2
;
_progressView
.
frame
=
CGRectMake
(
progressX
,
progressY
,
progressWH
,
progressWH
);
_progressView
.
frame
=
CGRectMake
(
progressX
,
progressY
,
progressWH
,
progressWH
);
[
self
recoverSubviews
];
[
self
recoverSubviews
];
_i
c
loudErrorIcon
.
frame
=
CGRectMake
(
20
,
[
TZCommonTools
tz_isIPhoneX
]
?
88
+
10
:
64
+
10
,
28
,
28
);
_i
C
loudErrorIcon
.
frame
=
CGRectMake
(
20
,
[
TZCommonTools
tz_isIPhoneX
]
?
88
+
10
:
64
+
10
,
28
,
28
);
_i
cloudErrorLB
.
frame
=
CGRectMake
(
53
,
[
TZCommonTools
tz_isIPhoneX
]
?
88
+
10
:
64
+
10
,
self
.
tz_width
-
63
,
28
);
_i
CloudErrorLabel
.
frame
=
CGRectMake
(
53
,
[
TZCommonTools
tz_isIPhoneX
]
?
88
+
10
:
64
+
10
,
self
.
tz_width
-
63
,
28
);
}
}
#pragma mark - UITapGestureRecognizer Event
#pragma mark - UITapGestureRecognizer Event
...
@@ -408,14 +400,14 @@
...
@@ -408,14 +400,14 @@
-
(
void
)
configSubviews
{
-
(
void
)
configSubviews
{
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
appWillResignActiveNotification
)
name
:
UIApplicationWillResignActiveNotification
object
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
appWillResignActiveNotification
)
name
:
UIApplicationWillResignActiveNotification
object
:
nil
];
_i
c
loudErrorIcon
=
[[
UIImageView
alloc
]
init
];
_i
C
loudErrorIcon
=
[[
UIImageView
alloc
]
init
];
_i
c
loudErrorIcon
.
image
=
[
UIImage
tz_imageNamedFromMyBundle
:
@"iCloudError"
];
_i
C
loudErrorIcon
.
image
=
[
UIImage
tz_imageNamedFromMyBundle
:
@"iCloudError"
];
_i
c
loudErrorIcon
.
hidden
=
YES
;
_i
C
loudErrorIcon
.
hidden
=
YES
;
_i
cloudErrorLB
=
[[
UILabel
alloc
]
init
];
_i
CloudErrorLabel
=
[[
UILabel
alloc
]
init
];
_i
cloudErrorLB
.
font
=
[
UIFont
systemFontOfSize
:
10
];
_i
CloudErrorLabel
.
font
=
[
UIFont
systemFontOfSize
:
10
];
_i
cloudErrorLB
.
textColor
=
[
UIColor
whiteColor
];
_i
CloudErrorLabel
.
textColor
=
[
UIColor
whiteColor
];
_i
cloudErrorLB
.
text
=
[
NSBundle
tz_localizedStringForKey
:
@"iCloud sync failed"
];
_i
CloudErrorLabel
.
text
=
[
NSBundle
tz_localizedStringForKey
:
@"iCloud sync failed"
];
_i
cloudErrorLB
.
hidden
=
YES
;
_i
CloudErrorLabel
.
hidden
=
YES
;
}
}
-
(
void
)
configPlayButton
{
-
(
void
)
configPlayButton
{
...
@@ -427,8 +419,8 @@
...
@@ -427,8 +419,8 @@
[
_playButton
setImage
:[
UIImage
tz_imageNamedFromMyBundle
:
@"MMVideoPreviewPlayHL"
]
forState
:
UIControlStateHighlighted
];
[
_playButton
setImage
:[
UIImage
tz_imageNamedFromMyBundle
:
@"MMVideoPreviewPlayHL"
]
forState
:
UIControlStateHighlighted
];
[
_playButton
addTarget
:
self
action
:
@selector
(
playButtonClick
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
_playButton
addTarget
:
self
action
:
@selector
(
playButtonClick
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
self
addSubview
:
_playButton
];
[
self
addSubview
:
_playButton
];
[
self
addSubview
:
_i
c
loudErrorIcon
];
[
self
addSubview
:
_i
C
loudErrorIcon
];
[
self
addSubview
:
_i
cloudErrorLB
];
[
self
addSubview
:
_i
CloudErrorLabel
];
}
}
-
(
void
)
setModel
:(
TZAssetModel
*
)
model
{
-
(
void
)
setModel
:(
TZAssetModel
*
)
model
{
...
@@ -451,15 +443,11 @@
...
@@ -451,15 +443,11 @@
if
(
self
.
model
&&
self
.
model
.
asset
)
{
if
(
self
.
model
&&
self
.
model
.
asset
)
{
[[
TZImageManager
manager
]
getPhotoWithAsset
:
self
.
model
.
asset
completion
:
^
(
UIImage
*
photo
,
NSDictionary
*
info
,
BOOL
isDegraded
)
{
[[
TZImageManager
manager
]
getPhotoWithAsset
:
self
.
model
.
asset
completion
:
^
(
UIImage
*
photo
,
NSDictionary
*
info
,
BOOL
isDegraded
)
{
if
(
!
photo
&&
[
info
[
PHImageResultIsInCloudKey
]
boolValue
])
{
BOOL
iCloudSyncFailed
=
!
photo
&&
[
info
[
PHImageResultIsInCloudKey
]
boolValue
];
self
->
_icloudErrorLB
.
hidden
=
NO
;
self
.
iCloudErrorLabel
.
hidden
=
!
iCloudSyncFailed
;
self
->
_icloudErrorIcon
.
hidden
=
NO
;
self
.
iCloudErrorIcon
.
hidden
=
!
iCloudSyncFailed
;
}
else
{
if
(
self
.
iCloudSyncFailedHandle
)
{
self
->
_icloudErrorLB
.
hidden
=
YES
;
self
.
iCloudSyncFailedHandle
(
self
.
model
.
asset
,
iCloudSyncFailed
);
self
->
_icloudErrorIcon
.
hidden
=
YES
;
}
if
(
self
.
iCloudSyncFailed
)
{
self
.
iCloudSyncFailed
(
self
.
model
.
asset
,
!
self
->
_icloudErrorLB
.
hidden
);
}
}
if
(
photo
)
{
if
(
photo
)
{
self
.
cover
=
photo
;
self
.
cover
=
photo
;
...
@@ -467,15 +455,11 @@
...
@@ -467,15 +455,11 @@
}];
}];
[[
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
(),
^
{
if
(
!
playerItem
&&
[
info
[
PHImageResultIsInCloudKey
]
boolValue
])
{
BOOL
iCloudSyncFailed
=
!
photo
&&
[
info
[
PHImageResultIsInCloudKey
]
boolValue
];
self
->
_icloudErrorLB
.
hidden
=
NO
;
self
.
iCloudErrorLabel
.
hidden
=
!
iCloudSyncFailed
;
self
->
_icloudErrorIcon
.
hidden
=
NO
;
self
.
iCloudErrorIcon
.
hidden
=
!
iCloudSyncFailed
;
}
else
{
if
(
self
.
iCloudSyncFailedHandle
)
{
self
->
_icloudErrorLB
.
hidden
=
YES
;
self
.
iCloudSyncFailedHandle
(
self
.
model
.
asset
,
iCloudSyncFailed
);
self
->
_icloudErrorIcon
.
hidden
=
YES
;
}
if
(
self
.
iCloudSyncFailed
)
{
self
.
iCloudSyncFailed
(
self
.
model
.
asset
,
!
self
->
_icloudErrorLB
.
hidden
);
}
}
[
self
configPlayerWithItem
:
playerItem
];
[
self
configPlayerWithItem
:
playerItem
];
});
});
...
@@ -500,8 +484,8 @@
...
@@ -500,8 +484,8 @@
[
super
layoutSubviews
];
[
super
layoutSubviews
];
_playerLayer
.
frame
=
self
.
bounds
;
_playerLayer
.
frame
=
self
.
bounds
;
_playButton
.
frame
=
CGRectMake
(
0
,
64
,
self
.
tz_width
,
self
.
tz_height
-
64
-
44
);
_playButton
.
frame
=
CGRectMake
(
0
,
64
,
self
.
tz_width
,
self
.
tz_height
-
64
-
44
);
_i
c
loudErrorIcon
.
frame
=
CGRectMake
(
20
,
[
TZCommonTools
tz_isIPhoneX
]
?
88
+
10
:
64
+
10
,
28
,
28
);
_i
C
loudErrorIcon
.
frame
=
CGRectMake
(
20
,
[
TZCommonTools
tz_isIPhoneX
]
?
88
+
10
:
64
+
10
,
28
,
28
);
_i
cloudErrorLB
.
frame
=
CGRectMake
(
53
,
[
TZCommonTools
tz_isIPhoneX
]
?
88
+
10
:
64
+
10
,
self
.
tz_width
-
63
,
28
);
_i
CloudErrorLabel
.
frame
=
CGRectMake
(
53
,
[
TZCommonTools
tz_isIPhoneX
]
?
88
+
10
:
64
+
10
,
self
.
tz_width
-
63
,
28
);
}
}
-
(
void
)
photoPreviewCollectionViewDidScroll
{
-
(
void
)
photoPreviewCollectionViewDidScroll
{
...
...
TZImagePickerController/TZImagePickerController/TZPhotoPreviewController.m
View file @
7e9114aa
...
@@ -460,7 +460,7 @@
...
@@ -460,7 +460,7 @@
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
;
TZVideoPreviewCell
*
currentCell
=
(
TZVideoPreviewCell
*
)
cell
;
currentCell
.
iCloudSyncFailed
=
^
(
id
asset
,
BOOL
isSyncFailed
)
{
currentCell
.
iCloudSyncFailed
Handle
=
^
(
id
asset
,
BOOL
isSyncFailed
)
{
model
.
iCloudFailed
=
isSyncFailed
;
model
.
iCloudFailed
=
isSyncFailed
;
[
weakSelf
refreshiCloudFailed
:
model
];
[
weakSelf
refreshiCloudFailed
:
model
];
[
weakSelf
.
models
replaceObjectAtIndex
:
indexPath
.
item
withObject
:
model
];
[
weakSelf
.
models
replaceObjectAtIndex
:
indexPath
.
item
withObject
:
model
];
...
@@ -468,7 +468,7 @@
...
@@ -468,7 +468,7 @@
}
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
;
TZGifPreviewCell
*
currentCell
=
(
TZGifPreviewCell
*
)
cell
;
currentCell
.
previewView
.
iCloudSyncFailed
=
^
(
id
asset
,
BOOL
isSyncFailed
)
{
currentCell
.
previewView
.
iCloudSyncFailed
Handle
=
^
(
id
asset
,
BOOL
isSyncFailed
)
{
model
.
iCloudFailed
=
isSyncFailed
;
model
.
iCloudFailed
=
isSyncFailed
;
[
weakSelf
refreshiCloudFailed
:
model
];
[
weakSelf
refreshiCloudFailed
:
model
];
[
weakSelf
.
models
replaceObjectAtIndex
:
indexPath
.
item
withObject
:
model
];
[
weakSelf
.
models
replaceObjectAtIndex
:
indexPath
.
item
withObject
:
model
];
...
@@ -497,7 +497,7 @@
...
@@ -497,7 +497,7 @@
}
}
}
}
}];
}];
photoPreviewCell
.
previewView
.
iCloudSyncFailed
=
^
(
id
asset
,
BOOL
isSyncFailed
)
{
photoPreviewCell
.
previewView
.
iCloudSyncFailed
Handle
=
^
(
id
asset
,
BOOL
isSyncFailed
)
{
model
.
iCloudFailed
=
isSyncFailed
;
model
.
iCloudFailed
=
isSyncFailed
;
[
weakSelf
refreshiCloudFailed
:
model
];
[
weakSelf
refreshiCloudFailed
:
model
];
[
weakSelf
.
models
replaceObjectAtIndex
:
indexPath
.
item
withObject
:
model
];
[
weakSelf
.
models
replaceObjectAtIndex
:
indexPath
.
item
withObject
:
model
];
...
...
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