Latest 1.0.0
Homepage https://github.com/darrarski/DRRxObservableArray
License MIT
Platforms ios 8.0, osx 10.10, requires ARC
Dependencies RxSwift
Authors

Build Status
Build Status
CocoaPods

Generic observable array for RxSwift. When its content changes (elements are inserted, removed or updated) it emits events from events Observable.

Usage

Example usage:

import RxSwift
import DRRxObservableArray

var observableArray = ObservableArray(["a", "b", "c"])
let _ = observableArray.events.subscribe(onNext: { event in 
    switch event {
        case .inserted(let indices, let elements):
            print("Inserted elements: (elements) at indices: (indices)")
        case .deleted(let indices, let elements):
            print("Removed elements: (elements) at indices: (indices)")
        case .updated(let indices, let oldElements, let newElements):
            print("Replaced elements: (oldElements) at indices: (indices) with elements: (newElements)")
    }
})

observableArray.append("d")
// Inserted elements: ["d"] at indices: [3]

observableArray.removeLast()
// Removed elements: ["d"] at indices: [3]

observableArray[1] = "B"
// Replaced elements: ["b"] at indices: [1] with elements: ["B"] 

Check out included unit tests for more examples.

Instalation

You can integrate DRRxObservableArray with your project using CocoaPods. To do so, you will need to add following line to your Podfile:

pod 'DRRxObservableArray', '~> 1.0'

You can also download zip archive of given release from releases page.

License

The MIT License (MIT) – check out included LICENSE file

Latest podspec

{
    "name": "DRRxObservableArray",
    "version": "1.0.0",
    "summary": "Generic observable array for RxSwift",
    "homepage": "https://github.com/darrarski/DRRxObservableArray",
    "authors": {
        "Dariusz Rybicki": "[email protected]"
    },
    "social_media_url": "https://twitter.com/darrarski",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "source": {
        "git": "https://github.com/darrarski/DRRxObservableArray.git",
        "tag": "v1.0.0"
    },
    "platforms": {
        "ios": "8.0",
        "osx": "10.10"
    },
    "source_files": "DRRxObservableArray",
    "requires_arc": true,
    "dependencies": {
        "RxSwift": [
            "~> 3.0"
        ]
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This