goodsamaritan goodsamaritan - 3 months ago 86x
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!