I am looking for better approach to sort an array of objects on the basis of array elements inside the object.
I have an array of objects to be shown as rows in UITableView
The row objects is having array of columns. There is a button to sort, which sort the rows on the basis of selected column
My object is bit complex but here putting forward simple object.
Example:
class AnimalOnEarth{
var animals:[Animals] = []
}
class Animals{
var animalName:String = ""
}
var listOfAnimal:[AnimalOnEarth] = [obj1,obj2,obj3,obj4]
I wanted to sort listOfAnimal on the basis of animalName reside as an element of array in animals object.
Kindly suggest

