Comments (8)
Your best option is probably to use https://github.com/ReactiveCocoa/ReactiveObjCBridge/ with https://github.com/ReactiveCocoa/ReactiveSwift/
from reactiveobjc.
@mdiep Thanks for the comment.
I'm currently migrating to Swift 3 and that's the main reason for this errors. Still, it must be done.
The problem of using ReactiveObjcBridge + ReactiveSwift is the boilerplate of bridging we will have in the code. A lot of our swift code is exposed to Objective-C and that already sucks.
It could make sense to migrate everything to swift in the near future.
Meanwhile, I found that adding the explicit type seems to work. I still don't understand why it can infer the correct type since the RACObserve function returns a RACSignal type.
Regarding RACStream it does not implement lightweight generics. Is there a reason for it ?
BR,
from reactiveobjc.
/cc @erichoracek
from reactiveobjc.
I have divided the several signals to understand where the ambiguity occurs:
let x1: RACSignal = self.RACObserve(self.settingsService.mib, "user_settings.pois.main_map_visible_categories")
let x2: RACSignal<AnyObject>! = x1.ignore(nil)
let x3 = x2.distinctUntilChanged()
Even by explicitly indicating the RACSignal type the compiler still founds it ambiguous.
from reactiveobjc.
This appears to be due to a Swift compiler issue that results from a method being declared both on a non-generic base class (RACStream
), as well as on a generic subclass (RACSignal<ValueType>
). Either of the following appear to resolve it:
- Declaring
RACStream
operations (e.g.distinctUntilChanged
) asNS_SWIFT_UNAVAILABLE
. - Giving
RACStream
a lightweight genericValueType
annotation.
The second option appears to be the most preferable, since that leaves -[RACStream distinctUntilChanged]
available to Swift consumers. Since the NS*
/NSMutable*
Foundation collections classes appear to work in ObjC and Swift with this pattern, I don't foresee there being an issue with attempting the second approach to fix this issue in RACObjC.
As such, unless anyone knows of any issues, I'll go ahead and make a PR with the second option.
from reactiveobjc.
@vitorhugomagalhaes please try 2.1.2 and make sure it resolves your issue. Let me know if it doesn't—thanks!
from reactiveobjc.
@erichoracek Thanks.
I will test the new version and get back to you asap.
from reactiveobjc.
I've filed this issue as https://bugs.swift.org/browse/SR-3529
from reactiveobjc.
Related Issues (20)
- RACObserve(target, key) HOT 1
- should I check the existance of weakself before @strongify(self) ? HOT 3
- [RACCommand addActiveExecutionSignal:]crashed HOT 2
- Error: 'ReactiveObjC/EXTKeyPathCoding.h' file not found?
- why the instruments say that the RAC Memory leaks?
- Why use pods package tools make static frame error ? .podspec is ok? HOT 1
- OSAtomic deprecation in iOS 10.0 HOT 1
- Xcode12 ReactiveObjC archive error HOT 2
- SMP HAVE NO SUPPORT
- 3.1.1 endless loop
- AVPlayerItem was deallocated while key value observers were still registered with it.
- crash in -[NSObject(RACDeallocating) rac_deallocDisposable] NSObject+RACDeallocating.m
- Delay delays cancelled stream completion
- 闪退 HOT 1
- m1 Can't install 3.1.1 via CocoaPods
- ReactiveObjC (3.1.1) Build Failed
- Get build errors with Xcode 15 HOT 3
- Xcode 15 Release build error "error: unexpected '@' in program @weakify(self); ^" HOT 2
- iOS 17 Crash
- Apple requires third-party SDKs to contain a privacy manifest file HOT 3
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 reactiveobjc.