KeyboardLayoutGuide
KeyboardLayoutGuide copied to clipboard
fix: support formSheet modal and floating keyboard
fixes: https://github.com/freshOS/KeyboardLayoutGuide/issues/33 fixes: https://github.com/freshOS/KeyboardLayoutGuide/issues/37
It turns out that formSheet automatically adjusts its position when keyboard is shown.
So I needed to fallback to use keyboardDidChangeFrameNotification instead of keyboardWillChangeFrameNotification in this use case.
This causes animation delay, but otherwise I couldn't calculate correct keyboardHeight inside formSheet.
https://user-images.githubusercontent.com/6007952/198422164-f36c506f-72d9-4816-96db-036baa8817e3.mp4
Usage is simple enough.
Just set Keyboard.shared.presentedViewController when you know what you're doing.
Keyboard.shared.presentedViewController = self
vStack.bottomAnchor.constraint(lessThanOrEqualTo: view.keyboardLayoutGuideNoSafeArea.topAnchor).isActive = true