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
UIKit Demo Issues #269
Comments
Hi @doubleo2 I have been focusing on the SwiftUI parts since launching v4, but chose to keep the UIKit utils around for a while for people who use that approach. However, I have no time to improve these parts of the library, nor the UIKit demo, so I should probably remove the demo, since it gives the wrong impression of the library. Still, if you or anyone else who use this library with UIKit feel like fixing the demo, I'd be super happy to merge any improvements you may have. The UIKit-exclusive parts of the library will be removed in v5, though. |
What do you mean by UIKit exclusive parts? Are you talking about internal implementation details or will it no longer be possible to create a UIKit keyboard extension with KeyboardKit starting in v5? |
You will always be able to use UIKit to create keyboards with KeyboardKit, since KK mostly contains view-agnostic utilities, but the library will not contain UIKit-specific utilities after v5...that is, utilities, views etc. that are only used in the UIKit demo. I will remove the UIKit demo and UIKit-specific views and extensions in v5, since I won’t be able to keep them up to date as the library evolves, like the UIKit demo shows. But you can still build keyboards with UIKit the way you do today, you will just have to setup your own views for the keyboard. |
hey, daniel, I was trying to build a custom keyboard with the help of UIKIT[uikit demo keyboard], it's providing the layout fine but none of the keys are working in that when we press certain keys actions are triggered but the keyboard is not typing anything in the text box, i am not able to find the reason for that. could you just point me where the problem could be in uikit keyboard demo bcz its using the same standard keyboard action handler file so should work fine. |
Hmmm, if the standard action handler is triggered (have you debugged to verify that it is?) and the text document proxy is set, then the typing should just work. |
I have debugged the code standard action handler is triggered and all the corresponding actions also working fine text document proxy is set but nothing typed in the text box |
override func viewDidLoad() { |
this is my code where I am calling the keyboard action handler |
Are you trying to type into the main app or a custom text field in the extension? |
for now in the main app but i will also have to do it in custom text field also in future |
import KeyboardKit /**
} private extension DemoKeyboardActionHandler {
} |
demo action handler these both methods are called(if let action = longPressAction(for: action) { return action } |
I haven't made any changes to the standard action handler so |
hey Daniel, hope you could spare some time for this. |
// import Combine /** The demo injects a custom, demo-specific action handler and The demo then sends text and emoji inputs to the text proxy,
If you want to use these features in your own app, you must
// view.addConstraint(heightConstraint)
// keyboardActionHandler = DemoKeyboardActionHandler(
} private extension KeyboardViewController {
} |
@shweta-poonia - the UIKit demo works when I try it from the main branch 🤔 See movie: |
but numeric keyboad is still not working in this one also |
Yeah, I noticed that now. With 4.0, I explicitly stopped working on UIKit support, but left the demo and some other UIKit-specific parts around for the community to keep up to date if they needed to. I will remove these parts altogether in 5.0, which I'll release later in H2. I unfortunately don't have the time nor resources to work on the UIKit parts, so if you want to go with that technology, I'm afraid I can't help as part of my spare time commitment to this project. I hope it's fairly easy to debug and see why the numeric switch doesn't toggle the keyboard. If you solve it, I'd be happy to merge any PRs you may have 👍 |
sure @danielsaidi I will look into this will get back to you. |
I am trying to get the UIKit demo working because I am building a keyboard that uses an SDK that needs to be configured in AppDelegate. The demo runs but it is broken in unexpected ways
123
key to switch to the numeric layout doesn't do anythingStandardAutocompleteSuggestion(text: "abc", title: "WILD")
causes the word "WILD" to be inserted when tapped. I would expect it to insert "abc"The first issue I was able to resolve by replacing
.newLine
inDemoButton.swift
with.return
The second seems to be caused by the guard at StandardKeyboardActionHandler.swift#L95 which prevents a tap on the keyboardType action from reaching the
tryChangeKeyboardType()
call.The third, I don't know. As far as I can tell, the replacement action takes the text from the suggestion, not the title, but it's clearly not working.
I suspect the fourth issue may be related to the fact that I'm unable to access the numeric layout.
Screenshot
The text was updated successfully, but these errors were encountered: