Изменения в новых версиях / Swift 5.3

// *** before: ***
enum PriorityOldIntComparable {
    case low, medium, high

    static func <(lhsPriorityOldrhsPriorityOld) -Bool {
        return lhs.rawValue < rhs.rawValue // a raw value invented only for the
        //order
    }
}

// *** in version 5.3: ***
enum PriorityComparable {
    case low
    case medium(urgent: Bool)
    case high
}

print(Priority.low < Priority.high)                       // true
print(Priority.medium(urgent: false) < .medium(urgent: true))
print([Priority.high, .low, .medium(urgent: true)].sorted())

// the order is the order in which the cases are written; associated values
// are compared one after another, and each of them must be Comparable