ReactiveCocoa 5.0

7ddcca09c00a2744b983974225447d19?s=47 Sho Ikeda
August 20, 2016

ReactiveCocoa 5.0

iOSDC Japan 2016での発表資料です #iosdc https://iosdc.jp/2016/c/node/189

7ddcca09c00a2744b983974225447d19?s=128

Sho Ikeda

August 20, 2016
Tweet

Transcript

  1. ReactiveCocoa 5.0 @ikesyo iOSDC Japan 2016 2016-08-20 Sat #iosdc

  2. @ikesyo • ͍͚͠ΐʔʗ஑ా ᠳ • ͸ͯͳ@ژ౎ • https://twitter.com/ikesyo • https://github.com/ikesyo

  3. None
  4. None
  5. None
  6. RAC 5.0

  7. RAC 5.0 • Repository Split • API Design • Signal

    • SignalProducer • Properties • Atomic • Others
  8. Repository Split • ReactiveCocoa: ReactiveSwift + UI layers • ReactiveSwift:

    The core, platform-independent Swift APIs • ReactiveObjC: Objective-C APIs (e.g. RACSignal) • ReactiveObjCBridge: Swift <-> ObjC bridging layer
  9. API Design • Swift 3 API Design Guidelines: • #3001

    [5.0] Swift 3.0 Groundwork • #3028 Isolate unavailable APIs in 5.0. • Easier transition by the use of "@available(*, unavailable, renamed:..."
  10. Signal • Lifetime Semantics: • #2959 [5.0] Changes to the

    lifetime semantic of Signal. • ϝϞϦʔorϦιʔεϦʔΫ͕ͪ͠ͳͷΛղফ
  11. SignalProducer • SignalProducer.buffer is removed: • #3028 Isolate unavailable APIs

    in 5.0. • Use Properties or SignalProducer.replayLazily instead • SignalProducer.on: • #3097 Pre- and post-start hooks in SignalProducer.on. • started -> starting, started ʹ෼ׂ
  12. Properties • #3023 Unifying read-only properties, and making PropertyProtocol class

    bound. • Renamed PropertyProtocol is now class bound • AnyProperty -> Property • ConstantProperty -> Property(value:) • #2922 Property composition operators. • Signal, SignalProducerͱಉ౳ͷΦϖϨʔλʔͷ௥Ճ
  13. Atomic • Optimizations: • #2984 Adopt inout parameter in Atomic.modify.

    • #3123 Alter Atomic.modify to return the result of the supplied action.
  14. Others • #3030 Add Lifetime to enable observation of object

    deallocation in Swift class MyController { private let token = Lifetime.Token() var lifetime: Lifetime { return Lifetime(token) } func viewDidLoad() { super.viewDidLoad() fooBarProducer() .take(until: lifetime.ended) // .take(until: rac_lifetime.ended) .startWithNext { ... } } }
  15. Others • #3133 Generic ScopedDisposable // Generic ScopedDisposable class ScopedDisposable<InnerDisposable:

    Disposable>: Disposable { ... } class MyController { private let disposable = ScopedDisposable(CompositeDisposable()) func viewDidLoad() { super.viewDidLoad() disposable += fooBarProducer().startWithNext { ... } // disposable.innerDisposable.add(fooBarProducer().startWithNext { ... }) } }
  16. ! Happy Reactive Coding!! !

  17. Thank you❗"