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
You can still use shorthand for sorted:
sorted
objNameSorted = objArray.sorted { $0 < $1 }
While less readable, it more closely mimics the sort syntax.
sort