Reactive Thinking in iOS Development - Reactive Amsterdam Meetup

Reactive Thinking in iOS Development - Reactive Amsterdam Meetup

In a world where Imperative Programming is the most used paradigm, Reactive comes up to make our code more reusable, robust, and stateless. Learn what Functional Reactive Programming means and how it could help you with problems you have to face daily in your projects. We’ll present basic concepts and practical examples for iOS developers that will help you to start thinking in streams, observers, .. and mix them with cool Swift functional concepts.

B0a336761194918a853deeff1f22b537?s=128

Pedro Piñera Buendía

May 12, 2016
Tweet

Transcript

  1. 2.

    WHO? @pepibumur iOS Developer at SoundCloud GitHub: pepibumur Twitter: pepibumur

    @saky iOS Developer at Letgo GitHub: isaacroldan Twitter: saky GitDo.io our spare time project
  2. 8.
  3. 9.

    INDEX 1. Why Reactive? I'm happy being imperative 2. What

    do we need? 3. How can I be Reactive? 4. It looks magic. Any Downside?
  4. 16.

    REACTIVECOCOA Version 1.0 (Objective-C) - February 2014 Version 2.0 (Objective-C)

    - September 2014 Version 3.0 (Objective-C) - September 2015 Swift launch - June 2014 Version 4.0 (Swift) - January 2015
  5. 19.

    RXSWIFT > More aligned to Rx > Not external dependencies.

    > More aligned with Swift error handling. > It provides extensions for Cocoa/UIKit, RxCocoa
  6. 20.

    THERE ARE SOME OTHERS > BrightFutures > ReactKit > Bond

    > More and more... PromiseKit, Bolts...
  7. 21.
  8. 27.

    let tracksFetcher = api.fetchTracks // Background .asObservable() .retry(3) .catchErrorJustReturn([]) .map(TrackEntity.mapper().map)

    .filter { $0.name.contains(query) } .flatMap { self.rx_trackImage(track: $0) } .observeOn(MainScheduler.instance) // Main thread
  9. 28.

    let tracksFetcher = api.fetchTracks // Background .asObservable .debug("after_fetch") // <--

    Debugging probes .retry(3) .catchErrorJustReturn([]) .map(TrackEntity.mapper().map) .debug("mapped_results") // <-- Debugging probes .filter { $0.name.contains(query) } .flatMap { self.rx_trackImage(track: $0) } .observeOn(MainScheduler.instance) // Main thread
  10. 29.

    //let tracksFetcher = api.fetchTracks // Background // .asObservable .debug("after_fetch") //

    <-- Debugging probes // .retry(3) // .catchErrorJustReturn([]) // .map(TrackEntity.mapper().map) .debug("mapped_results") // <-- Debugging probes // .filter { $0.name.contains(query) } // .flatMap { self.rx_trackImage(track: $0) } // .observeOn(MainScheduler.instance) // Main thread
  11. 30.
  12. 36.
  13. 43.