freshOS / KeyboardLayoutGuide

⌨️ KeyboardLayoutGuide, back from when it didn't exist.
MIT License
1.19k stars 60 forks source link

iOS15+ support keyboardLayoutGuide #38

Open KYHyeon opened 3 years ago

KYHyeon commented 3 years ago

It appears to officially support keyboardLayoutGuide from iOS15+. view.keyboardLayoutGuide causes errors 'keyboardLayoutGuide' is only available in iOS 15.0 or newer image

Reference: https://developer.apple.com/documentation/uikit/uiview/3752221-keyboardlayoutguide

shgew commented 3 years ago

If you import KeyboardLayoutGuide at the top of the file, the error goes away.

s4cha commented 3 years ago

@KYHyeon Yeah I saw they announced keyboardLayoutGuide and I figured names would probably collide. Looks like we got "Sherlocked" but I'm glad this is now becoming official, it's every maintainer goal ! Does @shgew solution fixes your issue? What version of Xcode are you using to be able to target iOS 15 ?

MainasuK commented 2 years ago

The workaround not fix the app target for iOS 15 only. The app still find and use the keyboardLayoutGuide from UIKit but not the package.

https://github.com/MainasuK/KeyboardLayoutGuide/tree/fix/iOS15 Rename the guide is works for me. That change will break the other dependencies. So if you think that is fine I could make a PR.

s4cha commented 2 years ago

@MainasuK that is weird, just tried locally creating an iOS15+ only app and whenever I add import KeyboardLayoutGuide at the top of the file, it uses the library one and the Native one when removing the import (see screenshots attached)

Screenshot 2022-01-17 at 17 52 50 Screenshot 2022-01-17 at 17 53 02
MainasuK commented 2 years ago

@s4cha You can try push a view in navigation stack or present a modal then dismiss it. The native one get a bug in iOS 15.0 build in my case.

The bug also described in that blog: https://useyourloaf.com/blog/keyboard-layout-guide/

azun-khang commented 2 years ago

Thanks @MainasuK . I have the same issue with you. Luckily, your workaround/fix works for me.