I believe you just need to specify the type of the array more explicitly when initializing it. This code works:
class Person {
var firstName: String = "FirstName"
var lastName: String = "LastName"
init(inputFirstName: String, inputLastName: String) {
firstName = inputFirstName
lastName = inputLastName
}
}
var people: [Person] = [Person]()
people.append(Person(inputFirstName: "A", inputLastName: "B"))
people.append(Person(inputFirstName: "B", inputLastName: "C"))
people.append(Person(inputFirstName: "C", inputLastName: "D"))
people.append(Person(inputFirstName: "D", inputLastName: "E"))
people.append(Person(inputFirstName: "E", inputLastName: "F"))
people.append(Person(inputFirstName: "F", inputLastName: "G"))
people.append(Person(inputFirstName: "G", inputLastName: "H"))
people.append(Person(inputFirstName: "H", inputLastName: "I"))
people.sort { $0.firstName > $1.firstName }