In my code, I have a struct like the following:
struct Object {
var name: String
var count: Int
I am now creating an array of 10 Object
Narusan, maybe this will help you. Let's say you have an array with your struct objects called objArray, then you can order it by the code bellow:
var objArray = [Object]()
objArray.append(Object(name:"Steve", count:0))
objArray.append(Object(name:"Alex", count:1))
objNameSorted = objArray.sorted (by: {$0.name < $1.name})
objNCountSorted = objArray.sorted (by: {$0.count < $1.count})