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
Text input? #51
Comments
Sorry for the delay in getting back to you! This is a complicated one since text fields have so much state. It's not possible to box up and restore that state, which is what you'd need to do if you wanted to make the view an implementation detail. Inside Facebook, we have a "stateful view wrapper" component that you can use with views like these. It basically makes a I'm looking over what it would take to move that component into this repo and open source it. For now, though, you could try writing it yourself! |
@adamjernst could you give some more details please? Lets say i need an UITextField. whats the best lifecycle method in the controller to create this view? UI elements should be created on the main thread but -init is called from a separate thread. |
I'm also very interested in this topic. Currently, I'm trying to make a good SwitchComponent-Implementation (for UISwitches). The tricky thing is that the UISwitch can change it's on-state through user-interaction without affecting the component state. So my general idea was to have a component which creates a reusable, blank If anyone is interested in taking a look at the source code, I pasted it here: https://gist.github.com/leoschweizer/667bf1476e25333459a2 However, at least on my old iPhone with iOS 7, this sometimes causes flickering as the Also, the I appreciate any input on how to make this implementation better. And once a satisfying state is reached, I also wouldn't mind making a pull request for it if desired. |
@leoschweizer do you have a new version of your gist or are you still using this implementation? |
@smiLLe no I don't have a better solution yet. However, I'm totally not satisfied with the current one due to the UI flickering and the unnecessarily restricted view reuse 😞 |
Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed. |
With the open sourcing of stateful view components you should be able to build this now. It's what we use internally for text views. |
It looks like this isn't supported out of the box and that the component TextKit exist in order to render text on a background queue?
What would a good way of handling text input from a UIText{Field,View} be? Wrap the textDidChange etc delegates/notifications in an compontent action?
The text was updated successfully, but these errors were encountered: