Priority

enum Priority
extension Priority : Comparable, Equatable, Hashable, RawRepresentable

An enum representing priority for a listener

  • Returns a Boolean value indicating whether the value of the first argument is less than that of the second argument.

    This function is the only requirement of the Comparable protocol. The remainder of the relational operator functions are implemented by the standard library for any type that conforms to Comparable.

    Declaration

    Swift

    static func < (lhs: Priority, rhs: Priority) -> Bool

    Parameters

    lhs

    A value to compare.

    rhs

    Another value to compare.

  • High priority indicates listener is called before .normal and .low priority listeners.

    Declaration

    Swift

    case high
  • Creates a new instance with the specified raw value.

    If there is no value of the type that corresponds with the specified raw value, this initializer returns nil. For example:

    enum PaperSize: String {
        case A4, A5, Letter, Legal
    }
    
    print(PaperSize(rawValue: "Legal"))
    // Prints "Optional("PaperSize.Legal")"
    
    print(PaperSize(rawValue: "Tabloid"))
    // Prints "nil"
    

    Declaration

    Swift

    init?(rawValue: Int)
  • low

    Low priority indicates listener is called after .normal and .high priority listeners.

    Declaration

    Swift

    case low
  • Normal priority indicates listener is called after .high priority listeners but before .low priority listeners.

    Declaration

    Swift

    case normal