Enums

The following enums are available globally.

  • Quality options for JPG images to be used when specifying jpg as the desired image format. Example usage

    let imageOptions = [.formatAs(.jpg(withQuality: .asPercent(50)))]
    
    See more

    Declaration

    Swift

    public enum JPGQuality
  • Use Format to specify the image file formats supported by Contentful’s Images API. Supported formats are jpg png and webp.

    See more

    Declaration

    Swift

    public enum Format: URLImageQueryExtendable
  • Use Focus to specify the focus area when resizing an image using either the Fit.thumb, Fit.fill and Fit.crop options. See Contentful’s Images API Reference Docs for more information.

    See more

    Declaration

    Swift

    public enum Focus: String
  • Fit

    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.

    See more

    Declaration

    Swift

    public enum Fit: URLImageQueryExtendable
  • A representation of Linked Resources that a field may point to in your content model. This stateful type safely highlights links that have been resolved to Entries, Assets, or if they are still unresolved. If your data model conforms to ContentModellable or EntryModellable you can also use the at method to extract an instance of your linked type.

    See more

    Declaration

    Swift

    public enum Link