Upgrade to Pro — share decks privately, control downloads, hide ads and more …

RAC用クラス拡張の作り方

 RAC用クラス拡張の作り方

ReactiveCocoa関西 LT

3fe447a7f9238108e6c50e97ac12717a?s=128

Kenichi Yonekawa

July 28, 2014
Tweet

Transcript

  1. ! RAC༻Ϋϥε֦ுͷ࡞Γํ @yonekawa

  2. None
  3. None
  4. ษڧձͱ͔Ͱ͖Δ޿͍εϖʔε ͋Γ·͢

  5. ؔ౦։࠵ΑΖ͘͠! ͓ئ͍͠·͢ʂʂ

  6. ReactiveCocoaͷ ͍͍ͱ͜Ζ

  7. FRPͱ͔MVVMͱ͔͸ ΋ͪΖΜ͚ͩͲ

  8. • [textField rac_textSignal] • [alertView rac_buttonClickedSignal] • [tableViewCell rac_prepareForReuseSignal] •

    [imagePicker rac_imageSelectedSignal] • [object rac_liftSelector:withSignals:]
  9. ૊ΈࠐΈΫϥε޲͚ͷ ֦ு͕ॆ࣮ͯ͠Δ

  10. αʔυύʔςΟϥΠϒϥϦͱ͔ ࣗ࡞Ϋϥε͸Ͳ͏͢Δʁ

  11. None
  12. ΧςΰϦ࡞Ε͹͍͍Α

  13. ࣮ࡍʹ৭ʑ࡞ͬͯΈͨ

  14. [SVProgressHUD rac_dismiss] SVProgressHUD͕dismiss͞ΕͨΒ(fade animation͕ ऴΘͬͨΒ)ൃՐ͢ΔRACSignalΛฦ͢

  15. • NSNotificationCenterͷ rac_addObserverForNameͰNotification͕ ඈΜͩ࣌ͷRACSignalΛ࡞੒ • ͦͷsignalΛsubscribeNextͨ͠blockͷதͰ ໭Γ஋༻ͷsubjectΛsendComplete͠ɺsignal Λdispose͢Δ

  16. [NJKWebViewProgress rac_updateSignal] NJKWebViewProgressDelegateͷ webViewProgress:updateProgress:͕ݺͼग़͞ΕΔ౓ ʹൃՐ͢ΔRACSignalΛฦ͢

  17. RACDelegateProxy • initWithProtocolͰࢦఆͨ͠Protocolʹ४ڌ ͨ͠ProxyΦϒδΣΫτΛ࡞੒ • ProxyΦϒδΣΫτͷsignalForSelectorͰ selector͕ݺ͹Εͨ࣌ʹൃՐ͢ΔRACSignalΛ ฦͯ͘͠ΕΔ

  18. [UIButton rac_16shotSignal] 1ඵؒʹ16ճϘλϯΛ࿈ଧ͢ΔͱൃՐ͢ΔRACSignalΛฦ͢

  19. https://github.com/ yonekawa/ RACSupportExamples