goodsamaritan goodsamaritan - 8 months ago 311
Swift Question

RxSwift Observable Array Sorting

I am trying to sort an observable array and havent had any luck (RxSwift n00b)

let items = [AnyObject]?
let locations = Observable.just(items)

I want to achieve something like this on locations

items.sortInPlace({$ < $})

Any pointers will be appreciated!


I figured

  1. initing locations as Variable([AnyObject]())
  2. setting locations asObservable
  3. sorting as locations.value.sortInPlace({$ < $})

Feels good!