Fit

public enum Fit : URLImageQueryExtendable

The various options available within Fit specify different resizing behaviors for use in conjunction with the ImageOption.fit(for: Fit) option. By default, images are resized to fit inside the bounding box given by w andh while retaining their aspect ratio. Using the Fit options, you can change this behavior.

  • If building for iOS, tvOS, or watchOS, Color aliases to UIColor. If building for macOS Color aliases to NSColor

    Declaration

    Swift

    public typealias Color = UIColor
  • If building for iOS, tvOS, or watchOS, Color aliases to UIColor. If building for macOS Color aliases to NSColor

  • If specifying an optional UIColor or NSColor make sure to also provide a custom width and height or else you may receive an error from the server. If the color cannot be resolved to a hex string by the SDK, an error will be thrown.

    Declaration

    Swift

    case pad(withBackgroundColor: Color?)
  • Specify that the image should be cropped, with an optional focus parameter.

    Declaration

    Swift

    case crop(focusingOn: Focus?)
  • Crop to the specified dimensions; if the original image is smaller than those specified, the image will be upscaled.

    Declaration

    Swift

    case fill(focusingOn: Focus?)
  • Creates a thumbnail with the specified focus.

    Declaration

    Swift

    case thumb(focusingOn: Focus?)
  • Scale the image regardless of the original aspect ratio.

    Declaration

    Swift

    case scale