mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-08 00:21:12 +00:00
Fix document sharing disabling
This commit is contained in:
parent
fb5f48afa8
commit
f441343f4c
@ -212,6 +212,16 @@ final class CompactDocumentPreviewController: QLPreviewController, QLPreviewCont
|
|||||||
for toolbar in self.toolbars {
|
for toolbar in self.toolbars {
|
||||||
toolbar.isHidden = true
|
toolbar.isHidden = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let navigationBar = navigationBars.first {
|
||||||
|
let imageViews = imageViewsInSubviews(forView: navigationBar)
|
||||||
|
for imageView in imageViews {
|
||||||
|
if imageView.frame.height > 4.0 {
|
||||||
|
imageView.isHidden = true
|
||||||
|
imageView.superview?.isUserInteractionEnabled = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
self.navigationItem.rightBarButtonItems = [UIBarButtonItem()]
|
self.navigationItem.rightBarButtonItems = [UIBarButtonItem()]
|
||||||
self.navigationItem.setRightBarButton(UIBarButtonItem(), animated: false)
|
self.navigationItem.setRightBarButton(UIBarButtonItem(), animated: false)
|
||||||
@ -246,6 +256,18 @@ final class CompactDocumentPreviewController: QLPreviewController, QLPreviewCont
|
|||||||
return (navigationBars, toolbars)
|
return (navigationBars, toolbars)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func imageViewsInSubviews(forView view: UIView) -> [UIView] {
|
||||||
|
var result: [UIView] = []
|
||||||
|
for subview in view.subviews {
|
||||||
|
if let subview = subview as? UIImageView {
|
||||||
|
result.append(subview)
|
||||||
|
} else {
|
||||||
|
let imageViews = imageViewsInSubviews(forView: subview)
|
||||||
|
result.append(contentsOf: imageViews)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func presentDocumentPreviewController(rootController: UIViewController, theme: PresentationTheme, strings: PresentationStrings, postbox: Postbox, file: TelegramMediaFile, canShare: Bool) {
|
func presentDocumentPreviewController(rootController: UIViewController, theme: PresentationTheme, strings: PresentationStrings, postbox: Postbox, file: TelegramMediaFile, canShare: Bool) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user