Sticker

@available(iOS 9.0, *)
@objcMembers
@objc(PESDKSticker)
open class Sticker : NSObject

A Sticker represents a single sticker in a sticker category. Each sticker needs an image and a thumbnail image. If no thumbnail is provided, it is automatically generated.

  • The URL for the sticker’s full size image. This can be a file url or a remote url.

    Declaration

    Swift

    public let imageURL: URL
  • The thumbnail URL of the sticker. If this is nil, it will be generated automatically from the full size image. This can be a file url or a remote url.

    Declaration

    Swift

    public let thumbnailURL: URL?
  • The tint mode that this sticker supports. Default is .none.

    Declaration

    Swift

    public var tintMode: StickerTintMode
  • This string is used to identify the sticker. It must be unique.

    Declaration

    Swift

    public let identifier: String
  • Whether brightness for this sticker can be adjusted. Default is false.

    Declaration

    Swift

    open var allowBrightnessAdjustment: Bool
  • Whether contrast for this sticker can be adjusted. Default is false.

    Declaration

    Swift

    open var allowContrastAdjustment: Bool
  • Whether saturation for this sticker can be adjusted. Default is false.

    Declaration

    Swift

    open var allowSaturationAdjustment: Bool
  • Creates a sticker with an image url and optionally a thumbnail url.

    Declaration

    Swift

    public convenience init(imageURL: URL, thumbnailURL: URL?, identifier: String)

    Parameters

    imageURL

    The url for the sticker’s full size image.

    thumbnailURL

    The url for the sticker’s thumbnail image.

  • Creates a sticker with an image url and optionally a thumbnail url.

    Declaration

    Swift

    public init(imageURL: URL, thumbnailURL: URL?, tintMode: StickerTintMode, identifier: String)

    Parameters

    imageURL

    The url for the sticker’s full size image.

    thumbnailURL

    The url for the sticker’s thumbnail image.

    tintMode

    The tint mode that this sticker supports.

  • Returns the first sticker with the given identifier, if any.

    Note

    This is a wrapper for AssetCatalog.shared.

    Declaration

    Swift

    public static func withIdentifier(_ identifier: String) -> Sticker?

    Parameters

    identifier

    The identifier of the sticker to look for.

    Return Value

    The sticker with the given identifier or nil.