-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
rx_observe can be more intuitive as rx_observe<AnyObject?> #60
Comments
Will try to figure out how to make this more user friendly. Have some ideas. |
Hm, I've tried to play with some ideas, but I don't right now I don't see a way to trick Swift compiler into some kind of default return value. @mbalex99 Do you have some ideas? I've documented everything here https://github.com/kzaher/RxSwift/blob/master/Documentation/GettingStarted.md#kvo Don't see we can do anything else. I've thought about adding Let me know what do you think. |
I think You can't easily cast generic's types. It's not good practice. So I think explicitly having rx_observeAsAnyObject makes it clear that you'll have to cast it yourself. It should be okay in the mean time. Maybe an option is to transform the KVO object into a Variable then just make rx_observe as an alias to that value. |
Hm, I guess I can add I would really like to maintain current api because correctly unwrapping This is the code needed to correctly unwrap
Do you think that adding Any other opinions/suggestions on this? |
I guess this has been addressed in the development cycle of RxSwift 2.0. I will close this issues, if anyone has something interesting to say about this, please consider opening a new issue referring to this one. :) |
rx_observe for KVO compliant objects is a little confusing
For example. I may want to store my apiToken in
I should be able to subsequently observe this like so
However the compiler doesn't understand this syntax.
It would be helpful if rx_observe was generically typed with
The text was updated successfully, but these errors were encountered: