SwiftagramCrypto Documentation

Structure Sticker

public struct Sticker: Wrapped  

A struct holding reference to a story sticker.

%237 Sticker Sticker Wrapped Wrapped Sticker->Wrapped

Conforms To

Wrapped

Initializers

init(wrapper:​)

public init(wrapper: @escaping () -> Wrapper)  

Init.

Parameters

wrapper @escaping () -> Wrapper

A valid Wrapper.

init(identifier:​wrapper:​)

public init(identifier: String, wrapper: Wrapper)  

Init.

Parameters

identifier String

A valid String.

wrapper Wrapper

A valid Wrapper.

Properties

identifier

public var identifier: String

The identifier.

offset

public var offset: CGPoint?  

The relative position.

level

public var level: Int?  

The zIndex.

rotation

public var rotation: CGFloat?  

The rotation in degrees.

wrapper

public var wrapper: () -> Wrapper

The underlying Response.

Methods

mention(_:​)

static func mention(_ identfier: String) -> Sticker  

Create a mension sticker for a given user.

Parameters

identifier

A valid user identifier.

Returns

A valid Sticker.

tag(_:​)

static func tag(_ tag: String) -> Sticker  

Create an hashtag sticker.

Parameters

tag String

A valid tag.

Returns

A valid Sticker.

location(_:​)

static func location(_ identifier: String) -> Sticker  

Create a location sticker.

Parameters

identifier String

A valid location identfiier.

Returns

A valid Sticker.

slider(_:​emoji:​)

static func slider(_ question: String, emoji: String) -> Sticker  

Create a slider sticker.

Parameters

question String

A valid String.

emoji String

A valid String containing a single emoji.

Returns

A valid Sticker.

countdown(to:​event:​can​BeFollowed:​)

static func countdown(to date: Date, event: String, canBeFollowed: Bool = true) -> Sticker  

Create a countdown sticker.

Parameters

date Date

A valid Date.

event String

A valid String

can​BeFollowed Bool

A valid Bool. Defaults to true.

Returns

A valid Sticker.

question(_:​)

static func question(_ question: String) -> Sticker  

Create a question sticker.

Parameters

question String

A valid String.

Returns

A valid Sticker.

poll(_:​tallies:​font​Size:​)

static func poll<S: Sequence>(_ question: String,
                                  tallies: S,
                                  fontSize: CGFloat = 28) -> Sticker where S.Element == String  

Create a poll sticker.

Parameters

question String

A valid String.

tallies S

A sequence of Strings. Only the last two will be used.

font​Size CGFloat

A CGFloat between 17.5 and 35. Defaults to 28.

Returns

A valid Sticker.

zIndex(_:​)

func zIndex(_ index: Int) -> Sticker  

Set a new zIndex to self.

Parameters

index Int

A valid Int.

Returns

A valid Sticker.

position(_:​)

func position(_ position: CGPoint) -> Sticker  

Set a relative position for self.

Parameters

position CGPoint

A valid CGPoint.

Returns

A valid Sticker.

position(x:​y:​)

func position(x: CGFloat? = nil, y: CGFloat? = nil) -> Sticker  

Set a relative position for self.

Parameters

x CGFloat?

An optional CGFloat. Defaults to nil, meaning x is not changed.

y CGFloat?

An optional CGFloat. Defaults to nil, meaning y is not changed.

Returns

A valid Sticker.

center()

func center() -> Sticker  

Center self in the middle of the canvas.

Returns

A valid Sticker.

rotate(by:​)

func rotate(by angle: CGFloat) -> Sticker  

Rotate self by angle in degrees.

Parameters

angle CGFloat

A valid CGFloat.

Returns

A valid Sticker.

scale(by:​)

func scale(by factor: CGFloat) -> Sticker  

Scale self by factor.

Parameters

factor CGFloat

A valid CGFloat.

Returns

A valid Sticker.

size(width:​height:​)

func size(width: CGFloat? = nil, height: CGFloat? = nil) -> Sticker  

Set relative size.

Parameters

width CGFloat?

An optional CGFloat. Defaults to nil, meaning width is not changed.

height CGFloat?

An optional CGFloat. Defaults to nil, meaning height is not changed.

Returns

A valid Sticker.