Slide 1

Slide 1 text

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

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

RAC 5.0

Slide 7

Slide 7 text

RAC 5.0 • Repository Split • API Design • Signal • SignalProducer • Properties • Atomic • Others

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

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:..."

Slide 10

Slide 10 text

Signal • Lifetime Semantics: • #2959 [5.0] Changes to the lifetime semantic of Signal. • ϝϞϦʔorϦιʔεϦʔΫ͕ͪ͠ͳͷΛղফ

Slide 11

Slide 11 text

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 ʹ෼ׂ

Slide 12

Slide 12 text

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ͱಉ౳ͷΦϖϨʔλʔͷ௥Ճ

Slide 13

Slide 13 text

Atomic • Optimizations: • #2984 Adopt inout parameter in Atomic.modify. • #3123 Alter Atomic.modify to return the result of the supplied action.

Slide 14

Slide 14 text

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 { ... } } }

Slide 15

Slide 15 text

Others • #3133 Generic ScopedDisposable // Generic ScopedDisposable class ScopedDisposable: Disposable { ... } class MyController { private let disposable = ScopedDisposable(CompositeDisposable()) func viewDidLoad() { super.viewDidLoad() disposable += fooBarProducer().startWithNext { ... } // disposable.innerDisposable.add(fooBarProducer().startWithNext { ... }) } }

Slide 16

Slide 16 text

! Happy Reactive Coding!! !

Slide 17

Slide 17 text

Thank you❗"