Vito Barba Vito Barba - 11 months ago 70
iOS Question

Sort a relationship in cosmicmind graph's library

I'm using the graph library and I need sort a relationship from a relationship.subject field [ " idOrder " ] .
it's possible to do it?
And if IdOrder isn't a int but a date?

Answer Source

yes you can do this for Swift 3, which is currently in the development branch.

_ = ["T1"]).sorted { (a, b) -> Bool in
        return a.subject!["idOrder"] as! Int > b.subject!["idOrder"] as! Int

All the best :)