ReactiveCocoa / ReactiveObjCBridge

Bridge between ReactiveObjC and ReactiveSwift
MIT License
63 stars 39 forks source link

Improve bridging experience. #26

Closed andersio closed 7 years ago

andersio commented 7 years ago

Swift API Guidelines prefer initialisers whenever it is possible. So a bunch of stuff is now converted to be initialisers.

  1. bridgedSignalProducer is renamed to SignalProducer.init(_:).

  2. bridgedAction is renamed to Action.init(_:).

  3. Scheduler.toRACScheduler() is deprecated in favour of the new RACScheduler.init(_:), which wraps an instance of Scheduler or DateScheduler.

  4. Introduce RACDisposable.init(_:) which wraps an instance of Disposable.

  5. toRACCommand() and toRACSignal() are deprecated in favour of a bridged computed property. Ideally these should be RACCommand.init(_:) and RACSignal.init(_:). However, even with Xcode 8.3 the compiler is still extremely conservative with Objective-C lightweight generics.

erichoracek commented 7 years ago

This will need to be rebased on top of #25β€”the overall pattern definitely seems like an improvement though πŸ‘

andersio commented 7 years ago

@erichoracek I was thinking if bridged should be named something else to avoid name collision. (Realised this when bootstrapping RAS-Rx bridge) πŸ™ƒ

@erichoracek @mdiep What do you think about .objCBridged?

mdiep commented 7 years ago

TBH I'm not bothered by a name collision with bridged since added properties to ReactiveSwift APIs should be rare. I'd be more inclined to use .rx to bridge to RxSwift. But I'd be okay with objCBridged too.

andersio commented 7 years ago

@ReactiveCocoa/reactivecocoa Feel free to take this over. 😸

erwald commented 7 years ago

@andersio I can have a look at it this weekend.