Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MessageInputBar hides and reappears slowly when QLPreviewController is dismissed using the Interactive gesture. #1747

Open
Zulqarnayn opened this issue Sep 22, 2022 · 3 comments
Labels

Comments

@Zulqarnayn
Copy link

Describe the bug
When QLPreviewController is dismissed using the swipe gesture, MessageInputBar hides and reappears slowly.

To Reproduce

  1. Tap on the keyboard
  2. Present a photo using QLPreviewController ( modalPresentationStyle = .fullScreen )
  3. dismiss QLPreviewController by swipe gesture
func presentQLPreviewController() {
    let controller = QLPreviewController()
    controller.modalPresentationStyle = .fullScreen
    controller.dataSource = self
    self.present(controller, animated: true)
}

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots

174591520-66eafc58-dc46-404f-9cae-2a743d4db6fc

Environment

  • What version of MessageKit are you using? - 6.1.0
  • What version of iOS are you running on? - iOS 15.5
  • What version of Swift are you running on? - - Swift 5
  • What device(s) are you testing on? Are these simulators? - iPhone / iPad
  • Is the issue you're experiencing reproducible in the example app? - Yes

Additional context
Add any other context about the problem here.

@ohserezha
Copy link

i have a similar issue - MessageInputBar reappears after modal presentation

@timetraveler90
Copy link

@SD10 - @Kaspik
Can you guys take a look at this as it's 100% reproducible all the time, even with the latest version

@bondarienko-iuliia
Copy link

bondarienko-iuliia commented Nov 6, 2023

I found a solution that worked for me:
The idea is to disable animation after QLPreviewController appears and enable it back in QLPreviewController’s viewDidDisappear.
To do that I create CustomQLPreviewController with completion handler, I call the handler in viewDidDisappear of the created class:

class CustomQLPreviewController: QLPreviewController {
    var completionHandler: (() -> Void)?
    
    override func viewDidDisappear(_ animated: Bool) {
        super.viewDidDisappear(animated)
        completionHandler?()
    }
}

Set completion handler after I create an instance of CustomQLPreviewController,
then enable animation back after presenting the custom QLPreviewController:

func presentQLPreviewController() {
    let qlvc = CustomQLPreviewController()
    qlvc.completionHandler = {
        UIView.setAnimationsEnabled(true)
    }
    qlvc.dataSource = self
    present(qlvc, animated: true, completion: nil)
    UIView.setAnimationsEnabled(false)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants