SortOrder

public enum SortOrder
extension SortOrder: Encodable

Represents a method by which to sort a collecton of values.

  • Sorts values by file size, either smallest first or biggest first.

    Declaration

    Swift

    case fileSize(ascending: Bool)
  • Sorts values by file extension, either A to Z or Z to A.

    Declaration

    Swift

    case fileExtension(ascending: Bool)
  • Sorts values by creation date, either oldest first or latest first.

    Declaration

    Swift

    case creationDate(ascending: Bool)
  • Sorts values by last modified date, either oldest first or latest first.

    Declaration

    Swift

    case lastModifiedDate(ascending: Bool)
  • Sorts values by name, either A to Z or Z to A.

    Declaration

    Swift

    case name(ascending: Bool)
  • A sort order that shuffles values.

    Declaration

    Swift

    case random
  • Encodes this value into the given encoder.

    Throws

    This function throws an error if any values are invalid for the given encoder’s format.

    Declaration

    Swift

    public func encode(to encoder: Encoder) throws

    Parameters

    encoder

    The encoder to write data to.