Fix live text button being behind edit attachment description text view

This commit is contained in:
Shadowfacts 2025-02-04 19:32:29 -05:00
parent 370b589a6b
commit 86e1403230
2 changed files with 11 additions and 1 deletions

View File

@ -76,6 +76,16 @@ class AttachmentWrapperGalleryContentViewController: UIViewController, GalleryCo
if !visible { if !visible {
editDescriptionViewController.textView?.resignFirstResponder() editDescriptionViewController.textView?.resignFirstResponder()
} }
if #available(iOS 16.0, macCatalyst 17.0, *),
let wrapped = wrapped as? ImageGalleryContentViewController,
let interaction = wrapped.analysisInteraction {
if visible {
let bottom = editDescriptionViewController.view.bounds.height - editDescriptionViewController.view.keyboardLayoutGuide.layoutFrame.height
interaction.supplementaryInterfaceContentInsets = UIEdgeInsets(top: 0, left: 0, bottom: bottom, right: 0)
} else {
interaction.supplementaryInterfaceContentInsets = .zero
}
}
} }
func galleryContentDidAppear() { func galleryContentDidAppear() {

View File

@ -25,7 +25,7 @@ open class ImageGalleryContentViewController: UIViewController, GalleryContentVi
private static let analyzer = ImageAnalyzer() private static let analyzer = ImageAnalyzer()
private var _analysisInteraction: AnyObject? private var _analysisInteraction: AnyObject?
@available(iOS 16.0, macCatalyst 17.0, *) @available(iOS 16.0, macCatalyst 17.0, *)
private var analysisInteraction: ImageAnalysisInteraction? { _analysisInteraction as? ImageAnalysisInteraction } public var analysisInteraction: ImageAnalysisInteraction? { _analysisInteraction as? ImageAnalysisInteraction }
public init(image: UIImage, caption: String?, gifController: GIFController?) { public init(image: UIImage, caption: String?, gifController: GIFController?) {
self.caption = caption self.caption = caption