I have a custom NSMutableArray and i want to sort it; I've looked over the internet but nothing solve my problem. what I have is the following Locations.swift
import UIKit
class Location: NSObject {
var id:String = String()
var name:String = String()
var distance:Float = Float()
}
then I create a Mutable Array from this class in my ViewController.swift
class CustomViewController: UIViewController{
var locations: NSMutableArray!
override func viewDidLoad() {
super.viewDidLoad()
locations = NSMutableArray()
locations = SqLite.getInstnace().getLocations()//get values from DB، objects of Location
}
}
how I can sort locations
by the distance
value??