Comments (6)
It seems it was replaced by bridgedSignalProducer(from:)
due to limitations of ObjC generics in Swift.
from reactiveobjcbridge.
You can produce a Signal
from a SignalProducer
using startWithSignal
. Note that the subscription side effect would run after the setUp
closure is invoked, but before startWithSignal
returns.
signal.toSignalProducer().startWithSignal { signal, interrupter in
// Do your stuff with `signal`.
}
from reactiveobjcbridge.
Thanks for getting back to me.
I'm afraid I didn't do a very good job describing my problem - I have an ObjC interface that looks like so:
@property (nonatomic, strong, readonly) RACSignal<NSDictionary *> *events;
Now, my view/business layer is written in swift mostly and I'm trying to combine events
with some other Swift-defined Signal
s. I was able to achieve the reverse, Swift->ObjC with ReactiveObjCBridge's extensions to SignalProtocol
public func toRACSignal() -> RACSignal<Self.Value.Wrapped>
but I'm not sure how I can transform a RACSignal
to a Signal
?
In your response, you said signal.toSignalProducer().startWithSignal { ... }
, but events.toSignalProducer()
throws compiler warning:
What am I missing? Thanks!
from reactiveobjcbridge.
@andersio @opfeffer
Could you please explain how to properly convert RACSignal to SignalProducer?
I've write something like
extension RACSignal {
func toSignalProducer() -> SignalProducer<ValueType, AnyError> {
return SignalProducer(self)
}
}
but the compiler warn at it(
from reactiveobjcbridge.
It should be ValueType?
since ValueType
is annotated as nullable for API backwards compatibility.
But AFAIK it still wonβt compile β there are plenty of restrictions in Swift regarding Objective-C lightweight generics, and they are part of the rationale behind the current interop API besides Swiftification. At least last when we tried, the compiler rejects any extension referring to any generic parameter.
from reactiveobjcbridge.
Yes, so i manually wrap every rac_.. to SignalProducer (
from reactiveobjcbridge.
Related Issues (14)
- Ready for a release yet? HOT 3
- Dependency update to ReactiveSwift 1.1.1? HOT 1
- 'ActionProtocol' is deprecated: This protocol is no longer necessary and will be removed in a future version of ReactiveSwift. Use Action directly instead. HOT 2
- Add support for bridging tuples to/from generic RACTuples HOT 1
- Argument labels '(racSwiftScheduler:)' do not match any available overloads HOT 2
- ReactiveObjCBridge errors on Swift master; possibly add this repo to Swift source compat suite? HOT 3
- Can't use as static library HOT 1
- Xcode 10 broken HOT 1
- Push 3.1.0 to CocoaPods trunk HOT 1
- carthage update fails HOT 1
- Cocoa pods spec has not been updated HOT 3
- how to "value" parameter in ResultExtensions.swift of ReactiveSwift folder
- error in ObjectiveCBridging.swift: Extraneous argument label 'racSwiftScheduler:' in call
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reactiveobjcbridge.