Hide the entire top toolbar for videos & audio (#1070)
This commit is contained in:
parent
a6a25426ee
commit
bd1339e9f2
|
@ -113,12 +113,11 @@ extension MediaPreviewViewController {
|
||||||
guard let self = self else { return }
|
guard let self = self else { return }
|
||||||
switch self.viewModel.item {
|
switch self.viewModel.item {
|
||||||
case .attachment(let previewContext):
|
case .attachment(let previewContext):
|
||||||
let needsHideCloseButton: Bool = {
|
self.topToolbar.isHidden = {
|
||||||
guard index < previewContext.attachments.count else { return false }
|
guard index < previewContext.attachments.count else { return false }
|
||||||
let attachment = previewContext.attachments[index]
|
let attachment = previewContext.attachments[index]
|
||||||
return attachment.kind == .video // not hide buttno for audio
|
return attachment.kind == .video || attachment.kind == .audio
|
||||||
}()
|
}()
|
||||||
self.closeButton.isHidden = needsHideCloseButton
|
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue