File

public protocol File

An file type.

Swift has no common built-in protocol for all file types. This protocol remedies that shortcoming.

  • The file’s name without its extension.

    Declaration

    Swift

    var stem: String? { get }
  • The file’s extension, if any.

    Declaration

    Swift

    var `extension`: String? { get }