-
Notifications
You must be signed in to change notification settings - Fork 150
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
How to Action bright CocoaAction #40
Comments
Neat idea! What do you think, @alexvbush? |
I like the idea! As far as I recall CocoaAction's signature is Action<Void,
|
@ashfurrow did you create At first I thought - why do we even need public extension UIButton<Input, Element> {
....
public var rx_action: Action<Input, Element>? {
.....
}
} the compiler complains with Also I found that there is a proposal for generic typealias for Swift 3 https://github.com/apple/swift-evolution/blob/master/proposals/0048-generic-typealias.md If I'm correct that we can't have generics in What do you think? |
hey, i found a way, in ReactiveCocoa https://github.com/ReactiveCocoa/ReactiveCocoa/blob/master/ReactiveCocoa/Swift/ObjectiveCBridging.swift
So, i can use like this:
thank you for your help. |
Looks great! That's exactly the reasoning behind the decision. What parts of your code do you think should be added to this codebase? |
Spent some time looking into this the other day. It's so unfortunate that we can't have generics in protocols and extensions and have to do something like @liyanhuadev did... |
Hi, is there anything new on this? I really enjoy using Action, but I would like a button to be able to hold an action that produces elements. But I cannot find a way to implement a toCocoaAction, or make the UIButton hold anything but a CocoaAction. How do you get around this? in the mean time I had to do
|
Hi @yoavschwartz – I don't think there's been any progress but someone should try again using Swift 4? Anyone available? |
After talking to @fpillet, for future reference this is the best solution I came to, if anyone is facing the same problem
|
|
hi, thank you for you library.
i have a question:
let loadAction: Action<Void, String>
observer result:
loadAction.elements.subscribeNext { (result) in // do something }
and i can use rx_action
btn.rx_action = viewModel.loadAction.toCocoaAction()
What I want to do toCocoaAction
The text was updated successfully, but these errors were encountered: