Overlay

@available(iOS 9.0, *)
@objcMembers
@objc(PESDKOverlay)
open class Overlay : NSObject

An Overlay represents a unique overlay that can be added to a photo.

  • This string is used to identify the overlay, it must be unique.

    Declaration

    Swift

    public private(set) var identifier: String
  • url

    The URL of the image.

    Declaration

    Swift

    public private(set) var url: URL?
  • The URL of the thumbnail for this overlay. If none is provided, the url will be used.

    Declaration

    Swift

    public private(set) var thumbnailURL: URL?
  • This string will be used within the UI.

    Declaration

    Swift

    public private(set) var displayName: String
  • This mode will be set when the overlay is selected in the UI.

    Declaration

    Swift

    public private(set) var initialBlendMode: BlendMode
  • Initialize a new Overlay

    Declaration

    Swift

    public init(identifier: String, displayName: String, url: URL?, thumbnailURL: URL? = nil, initialBlendMode: BlendMode)

    Parameters

    identifier

    An identifier.

    displayName

    This will be used within the UI.

    url

    The URL of the image.

    thumbnailURL

    The URL of the thumbnail for this overlay. If none is provided, the url will be used.

  • Get the overlay from the pool with the given identifier.

    Declaration

    Swift

    public static func overlay(withIdentifier identifier: String) -> Overlay?

    Parameters

    identifier

    An identifier.

    Return Value

    The overlay that matches the identifier, nil otherwise.

  • This is a special case of an overlay. It means, apply no overlay at all.

    Declaration

    Swift

    public static var none: Overlay { get }
  • all

    This array represents the pool of overlays available to the SDK.

    Declaration

    Swift

    public static var all: [Overlay] = [
     Overlay.none,
     Overlay(identifier: "imgly_overlay_golden", displayName: "pesdk_overlay_asset_golden".localized, url: Bundle.imglyBundle.url(forResource: "imgly_overlay_golden", withExtension: "jpg"), thumbnailURL: Bundle.imglyBundle.url(forResource: "imgly_overlay_golden_thumb", withExtension: "jpg"), initialBlendMode: .lighten),
     Overlay(identifier: "imgly_overlay_lightleak1", displayName: "pesdk_overlay_asset_lightleak".localized, url: Bundle.imglyBundle.url(forResource: "imgly_overlay_lightleak1", withExtension: "jpg"), thumbnailURL: Bundle.imglyBundle.url(forResource: "imgly_overlay_lightleak1_thumbnail", withExtension: "jpg"), initialBlendMode: .screen),
     Overlay(identifier: "imgly_overlay_rain", displayName: "pesdk_overlay_asset_rain".localized, url: Bundle.imglyBundle.url(forResource: "imgly_overlay_rain", withExtension: "jpg"), thumbnailURL: Bundle.imglyBundle.url(forResource: "imgly_overlay_rain_thumb", withExtension: "jpg"), initialBlendMode: .overlay),
     Overlay(identifier: "imgly_overlay_mosaic", displayName: "pesdk_overlay_asset_mosaic".localized, url: Bundle.imglyBundle.url(forResource: "imgly_overlay_mosaic", withExtension: "jpg"), thumbnailURL: Bundle.imglyBundle.url(forResource: "imgly_overlay_mosaic_thumb", withExtension: "jpg"), initialBlendMode: .multiply),
     Overlay(identifier: "imgly_overlay_vintage", displayName: "pesdk_overlay_asset_vintage".localized, url: Bundle.imglyBundle.url(forResource: "imgly_overlay_vintage", withExtension: "jpg"), thumbnailURL: Bundle.imglyBundle.url(forResource: "imgly_overlay_vintage_thumb", withExtension: "jpg"), initialBlendMode: .darken),
     Overlay(identifier: "imgly_overlay_paper", displayName: "pesdk_overlay_asset_paper".localized, url: Bundle.imglyBundle.url(forResource: "imgly_overlay_paper", withExtension: "jpg"), thumbnailURL: Bundle.imglyBundle.url(forResource: "imgly_overlay_paper_thumb", withExtension: "jpg"), initialBlendMode: .multiply)
    ]