File

public struct File : Codable

Represents a file retrieved from library

  • The identifier of the file

    Declaration

    Swift

    public let identifier: String
  • The file’s metadata

    Declaration

    Swift

    public let metadata: FileMetadata
  • The file’s raw data

    Declaration

    Swift

    public let data: Data
  • The file’s raw data

    Declaration

    Swift

    public let updatedDate: Date
  • The file’s MIME type

    Declaration

    Swift

    public var mimeType: MimeType { get }
  • Convenience function to return data as JSON object, if possible

    Declaration

    Swift

    @discardableResult
    public func toJSON(persistResult: Bool = false) -> Any?

    Return Value

    JSON object or nil if deserialization unsuccesful

  • Convenience function to return data as UIImage, if possible

    Declaration

    Swift

    public func toImage() -> UIImage?

    Return Value

    UIImage or nil if mime type is not an image type

  • Declaration

    Swift

    public init(from decoder: Decoder) throws
  • Declaration

    Swift

    public func encode(to encoder: Encoder) throws