ReactiveCocoa v4.2.1 發布

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

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

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

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

更新日志

新增

  • Signal.debounce()/SignalProducer.debounce() for sending values interval seconds apart (#2952, thanks @mdiep and @natestedman!)
  • ObserverType protocol for type-constrained extensions of Observer (#2992, thanks@natestedman!)
  • flatten() variants that operate on SequenceTypes (#2975, thanks @miikegb!)

Bug修復

  • Binding a producer to a MutablePropertyType leaked memory (#2961, thanks @github-user32!)
  • zip()d producers didn’t complete after both sources completed (#2972, thanks @andersio!)
  • then() didn’t forward interruptions from the original producer (#2987, thanks @sharplet!)
  • TestScheduler didn’t have the correct currentDate while advancing (#2991, thanks @inamiy!).

下載

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