CollectionVariable 0.1.0

CollectionVariable 0.1.0

测试已测试
语言语言 SwiftSwift
许可证 MIT
发布最后发布2017年5月
SwiftSwift 版本3.0
SPM支持 SPM

Pedro PiñeraIsaac Roldán 维护。



  • @pepibumur

CollectionVariable

RxSwift 的 CollectionVariable 概念的实现

@pepibumur 实现

特性

  • Swift 2.0
  • 细粒度报告集合更改(自定义事件)
  • 它公开了 Swift Array 集合方法
  • 受 NSFetchedResultsController 启发
  • RxSwift 2.1.X

如何安装

  1. 获取 Carthage,brew update carthage
  2. github "gitdoapp/CollectionVariable" 添加到您的 Cartfile
  3. 执行 carthage update
  4. 按照以下步骤将 Carthage 生成的框架添加到您的项目中。

如何使用它

  1. 创建您的类型为 CollectionVariable 的属性
let variable: CollectionVariable<String> = CollectionVariable(["test1", "test2"])
  1. 使用可用的订阅者属性
variable.observable.subscribeNext { newCollection in
  // Do whatever you want with the new collection
  // e.g. tableView.reloadData()
}
variable.changesObservable.subscribeNext { change in
  switch change {
    case Remove(Int, T)
    case Insert(Int, T)
    case Composite([CollectionChange])
  }
}

开发者

  • 如果您遇到任何问题,请联系 [email protected]
  • 您也可以在仓库中创建一个关于您的关注点、问题的工单。
  • 如果您想为该组件做出贡献,请记住添加测试以测试您的新功能。

许可证

The MIT License (MIT)

Copyright (c) 2015 GitDo

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.