Is RxSwift for me? @ try! Swift NYC

Bbb75c4dd2e17a7e3114c730ec7144d0?s=47 Marin Todorov
September 03, 2016

Is RxSwift for me? @ try! Swift NYC

It's difficult to make the jump from map and filter to say ... presenting view controllers or search bars that need to call an API on the web and populate a table view. To be honest, at first it seems almost like functional or reactive programming has nothing to do with UIKit or NSURLSession...

In this talk Marin (me) will show you how RxSwift (an async, event based framework) applies in few every day situations of the life of an iOS developer. If you like major pains being solved for you transparently at the price of a single dependance this talk is for you.

Bbb75c4dd2e17a7e3114c730ec7144d0?s=128

Marin Todorov

September 03, 2016
Tweet

Transcript

  1. I create iOS apps -
 is RxSwift for me? try!

    Swift NYC Marin Todorov mt@realm.io
  2. An async, event based framework mt@realm.io

  3. The reactive side of Rx mt@realm.io

  4. Array<String> mt@realm.io 0 first 1 second 2 third

  5. mt@realm.io 0 first 1 second 2 third 3 fourth

  6. mt@realm.io 0 first 1 second 2 third 3 fourth

  7. mt@realm.io 0 first 1 second 2 third Image Credit: NASA

    Goddard Space Flight Center
  8. Observable<Array<String>> mt@realm.io 0 first 1 second 2 third 3 fourth

    4 fifth Not an actual Rx code
  9. mt@realm.io 0 first 1 second 2 third 0 first 1

    second 2 third 3 fourth 0 first 1 second 2 third 3 fourth 4 fifth
  10. mt@realm.io Pending number: fif fif Pending number: fift fift Pending

    number: fifth fifth
  11. mt@realm.io

  12. The functional side of Rx mt@realm.io

  13. mt@realm.io Pending number: fif fif Observable<String> 0 first 1 second

    2 third 3 fourth Observable<Array<…>> Observable<Void>
  14. mt@realm.io marin Observable<String> filter length > 3 Observable<String> debounce interval

    > 0.5s Observable<String> flatMapLatest NSData Observable<NSData> map Array<AnyObject> Observable<Array<AnyObject>> map NSURLRequest(…) Observable<NSURLRequest> map Repo(…) Observable<Array<Repo>>
  15. mt@realm.io

  16. F&R App Architecture mt@realm.io

  17. mt@realm.io

  18. mt@realm.io

  19. mt@realm.io ViewModel RxSwift Code RxSwift Code ViewModel MVVM RxTests Binding

    Code Binding Code
  20. RxSwift 1. Sync-like async code 2. With a functional aspect

    3. That encourages good architecture mt@realm.io
  21. We’re hiring mt@realm.io • iOS Evangelist • Android Evangelist •

    C++ Core • Javascript • Automation Engineer • C# Engineer • Product Manager • and much more! realm.io/jobs
  22. mt@realm.io Further Reading & Credits http://reactivex.io (RxSwift, RxJava, RxJS, …)

    http://rxswift.org (links to GitHub) http://rx-marin.com Thanks : Ash Furrow, Jens Ravens, Florent Pillet, Junior Bontognali, Krunoslav Zaher
  23. mt@realm.io Questions? Marin Todorov mt@realm.io www.realm.io @icanzilb