Skip to content

Commit 27c8ef3

Browse files
committed
feat: doing handle preview controller
1 parent df98fb2 commit 27c8ef3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ios/CustomPhotoPicker/CustomPhotoPickerViewController.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ class CustomPhotoPickerViewController: TLPhotosPickerViewController, ViewerContr
2323
func viewerController(_ viewerController: ViewerController, viewableAt indexPath: IndexPath) -> Viewable {
2424
let viewable = ViewerPhoto(id: UUID().uuidString)
2525

26-
if let cell = collectionView?.cellForItem(at: indexPath) as? Cell, let placeholder = cell.imageView?.image {
26+
if let cell = collectionView?.cellForItem(at: indexPath) as? Cell, let placeholder = cell.imageView?.image, let asset = cell.asset {
27+
viewable.assetID = asset.localIdentifier
28+
29+
if asset.duration > 0 {
30+
viewable.type = .video
31+
}
32+
2733
viewable.placeholder = placeholder
2834
}
2935

0 commit comments

Comments
 (0)