1

I need to sort an array of custom classes by a class variable. This used to be easy for me in Objective C using sort descriptors, but for some reason I cannot get that to work in Swift. I have a class like this:

class Show : NSObject
{
    init()
    {
        super.init()
    }

    var firstName: String!
    var lastName: String!
}

I am creating my array like this:

var peopleArray = Show[]()

How do I sort the array by last names?

0

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.