fix: dismiss image may crash issue due to source view gone
This commit is contained in:
parent
20b3bed99f
commit
ae58230581
@ -18,9 +18,9 @@ extension MediaPreviewableViewController {
|
|||||||
case .mosaic(let mosaicImageViewContainer):
|
case .mosaic(let mosaicImageViewContainer):
|
||||||
guard index < mosaicImageViewContainer.imageViews.count else { return nil }
|
guard index < mosaicImageViewContainer.imageViews.count else { return nil }
|
||||||
let imageView = mosaicImageViewContainer.imageViews[index]
|
let imageView = mosaicImageViewContainer.imageViews[index]
|
||||||
return imageView.superview!.convert(imageView.frame, to: nil)
|
return imageView.superview?.convert(imageView.frame, to: nil)
|
||||||
case .profileAvatar(let profileHeaderView):
|
case .profileAvatar(let profileHeaderView):
|
||||||
return profileHeaderView.avatarImageView.superview!.convert(profileHeaderView.avatarImageView.frame, to: nil)
|
return profileHeaderView.avatarImageView.superview?.convert(profileHeaderView.avatarImageView.frame, to: nil)
|
||||||
case .profileBanner:
|
case .profileBanner:
|
||||||
return nil // fallback to snapshot.frame
|
return nil // fallback to snapshot.frame
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user