Be aware that the reorder method fails if the id could not be found in unsorted
func reorder(items: [MyObject], order : [String]) -> [String] {
var unsorted = items
var ordered : [String] = []
for orderId in order {
let index = unsorted.filter{ $0.id == orderId }.first
let found = unsorted.remove(at: index!)
ordered.append(found)
}
return ordered
}