ReactiveCocoa v4.2 發布

jopen 8年前發布 | 9K 次閱讀 MVVM ReactiveCocoa

ReactiveCocoa的核心為signals即RACSignal類。Signals發出三種類型的事件流:next、completed、和error。

通過此模式,ReactiveCocoa可以用來替代delegate、target-action、key-value observing等模式。

通過signal API創建的代碼更加統一且易讀.但ReactiveCocoa真正強大之處在于通過這些信號源能進行更多高級操作.這些操作能在相當簡潔高雅的操作下執行復雜的篩選、轉換、信號協調等。在MVVM中,ReactiveCocoa扮演著重要角色.它提供ViewModel和View之間的綁定操作。

更新日志

新增

改進

  • SignalProducer.replayLazily() no longer uses NSObject (#2811, thanks @ikesyo!)
  • NSNotificationCenter.rac_notifications() will now interrupt if the object deallocates before the producer starts (#2859, thanks @ikesyo and @andymatuschak!)
  • <~ will now automatically bridge values to Objective-C (#2551, thanks @sharplet!)

修復

  • Memory leak in SignalProducer.lift(), which is used internally in many operators (#2800, thanks@ikesyo and @trifonov-ivan!)
  • Recursive observation of MutablePropertys (#2764, thanks @andersio and @olegshnitko!)
  • Replace uses of spinlocks because they’re not safe on some devices (#2670, thanks@Adlai-Holler!)
  • Potential deadlock in SignalProducer.buffer() (#2900, thanks @mdiep!)
  • SignalProducer.replayLazily() won’t interrupt while there are active subscriptions (#2903, thanks@mdiep!)
  • Retain cycle with Action.unsafeCocoaAction (#2910, thanks @mdiep!)
  • UIScheduler now delivers events on the main queue (#2912, thanks @ikesyo!)

Objective-C

新增

  • RACDelegateProxy is now public (#2869, thanks @mdiep!)

改進

  • RACCommand now specifies that its InputType is contravariant (#2696, thanks @erichoracek!)

修復

  • Behavior of -[RACSequence foldRightWithStart:reduce:] (#2777, thanks @ikesyo!)
  • Memory leak in -[UIControl rac_signalForControlEvents:] (#2797, thanks @vagase!)
  • Memory leak in RACSubject (#2845, thanks @ikesyo and @tzongw!)
  • Retaining of signals in -[RACSignal bind:], which underpins most operators (#2935, thanks@tzongw!)

下載

 

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!