Filestack Documentation

Class Transformable

public class Transformable: NSObject  

Represents an Transformable object.

See Image Transformations Overview for more information about image transformations.

Transformable Transformable NSObject NSObject Transformable->NSObject

Conforms To

NSObject

Properties

api​Key

@objc public let apiKey: String

An API key obtained from the Developer Portal.

security

@objc public let security: Security? 

A Security object. nil by default.

handle

@objc public var handle: String?  

A Filestack Handle. nil by default.

handles

@objc public var handles: [String]?  

An array of Filestack Handles. nil by deafult.

external​URL

@objc public var externalURL: URL?  

An external URL. nil by default.

external​URLs

@objc public var externalURLs: [URL]?  

An array of external URLs. nil by default.

url

@objc public var url: URL  

An URL corresponding to this image transform.

description

override public var description: String  

:nodoc:

Methods

store(file​Name:​location:​path:​container:​region:​access:​base64Decode:​queue:​completion​Handler:​)

@objc
    @available(*, deprecated, message: "Marked for removal in version 3.0. Use the new store(using:base64Decode:queue:completionHandler) instead")
    @discardableResult
    public func store(fileName: String? = nil,
                      location: StorageLocation,
                      path: String? = nil,
                      container: String? = nil,
                      region: String? = nil,
                      access: StorageAccess,
                      base64Decode: Bool,
                      queue: DispatchQueue? = .main,
                      completionHandler: @escaping (FileLink?, JSONResponse) -> Void) -> Self  

Stores a copy of the transformation results to your preferred filestore.

Parameters

file​Name String?

Change or set the filename for the converted file.

location Storage​Location

An StorageLocation value.

path String?

Where to store the file in your designated container. For S3, this is the key where the file will be stored at.

container String?

The name of the bucket or container to write files to.

region String?

S3 specific parameter. The name of the S3 region your bucket is located in. All regions except for eu-central-1 (Frankfurt), ap-south-1 (Mumbai), and ap-northeast-2 (Seoul) will work.

access Storage​Access

An StorageAccess value.

base64Decode Bool

Specify that you want the data to be first decoded from base64 before being written to the file. For example, if you have base64 encoded image data, you can use this flag to first decode the data before writing the image file.

queue Dispatch​Queue?

The queue on which the completion handler is dispatched.

completion​Handler @escaping (File​Link?, JSONResponse) -> Void

Adds a handler to be called once the request has finished.

add(transform:​)

@discardableResult
    func add(transform: Transform) -> Self  

Adds a new transformation to the transformation chain.

Parameters

transform Transform

The Transform to add.

debug()

@objc
    @discardableResult
    func debug() -> Self  

Includes detailed information about the transformation request.

store(using:​base64Decode:​queue:​completion​Handler:​)

@objc
    @discardableResult
    func store(using options: StorageOptions,
               base64Decode: Bool = false,
               queue: DispatchQueue? = .main,
               completionHandler: @escaping (FileLink?, JSONResponse) -> Void) -> Self  

Stores a copy of the transformation results to your preferred filestore.

Parameters

options Storage​Options

An StorageOptions value.

base64Decode Bool

Specify that you want the data to be first decoded from base64 before being written to the file. For example, if you have base64 encoded image data, you can use this flag to first decode the data before writing the image file.

queue Dispatch​Queue?

The queue on which the completion handler is dispatched.

completion​Handler @escaping (File​Link?, JSONResponse) -> Void

Adds a handler to be called once the request has finished.