ReactiveCocoa for CincyCocoaDev Meetup

426 views

Published on

An intro to ReactiveCocoa for iOS

Published in: Software, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
426
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

ReactiveCocoa for CincyCocoaDev Meetup

  1. 1. REACTIVECOCOA A Dive into Functional Reactive Programming
  2. 2. SAM CORDER @samcorder sam.corder@pinnsg.com
  3. 3. STATE OF STATE • KVO • Callback Blocks • Delegates • Target-action mechanisms • Notifications
  4. 4. CODE
  5. 5. RAC CODE
  6. 6. RAC DEFINED • RAC Definition • RAC Birth • My History
  7. 7. TERMS • RACStream • RACSignal • RACSubscriber • RACCommand • RACSequence [Soon to be deprecated]
  8. 8. STREAMS • Base class for the interesting classes • Pipes of values retrieved sequentially • Composed and operated on with operators
  9. 9. SIGNALS • Push driven stream • Must be subscribed to • Sends 3 types of events • Next • Error • Complete
  10. 10. TRANSFORMING OPERATORS • Mapping - map: • Filtering - filter: • Concatenating - concat: • Flattening - flatten: • Mapping and Flattening - flattenMap:
  11. 11. COMBINING OPERATORS • +merge: • +combineLatest: • +switchToLatest:
  12. 12. SUBSCRIBER • subscribeNext:error:complete d:
  13. 13. CODE
  14. 14. COMMANDS • Creates and subscribes to a signal in response to action. • Can be disabled based on a signal
  15. 15. CODE
  16. 16. MISC GEMS • @weakify/@strongify • RAC() is a macro that makes the binding look nicer. • [RACObserve(self, event) subscribeNext:^(Type *vale) {...}]; • [[self rac_signalForSelector:@selector(selector:) fromProtocol:@protocol(SomeDelegate)] • RACTupleUnpack(Type1 * var1, Type2 * var2…) = args;
  17. 17. MVVM Under MVVM, the view and view controller become formally connected; we treat them as one. Views still don’t have references to the model, but neither do controllers. Instead, they reference the view model.
  18. 18. –Lillian Smith “When you stop learning, stop listening, stop looking and asking questions, always new questions, then it is time to die.”
  19. 19. RESOURCES • Ray Wenderlich - 2 part tutorial plus YouTube video • ReactiveCocoa at github. - Read the documentation folder • Ash Furrow’s blog - teehan+lax • Ash Furrow’s book - Functional Reactive Programming on iOS (Lean Pub) • Warning: Some blogs and Stackoverflow posts are based on older versions of RAC. Make sure it refers to 2.x

×