CreationKit Documentation

Class Action

public final class Action  

An action that can be taken when the user taps a button.

You use this class to configure information about a single action, including the title to display in the button, any styling information, and a handler to execute when the user taps the button.

Nested Types


Styles to apply to action buttons.



public init(
    title: String, image: UIImage? = nil,
    imageSide: LateralDirection = .left, style: Style = .default, handler: ((Action) -> Void)? = nil

Create and return an action with the specified title and behavior.

Actions are enabled by default when you create them.


title String

The text to use for the button title.

image UIImage?

The image to place next to the actions title.

style Style

Additional styling information to apply to the button. Use the style information to convey the type of action that is performed by the button.

handler ((Action) -> Void)?

A closure to execute when the user selects the action. This closure has no return value and takes the selected action object as its only parameter.



public var title: String

The title of the action's button.


public var image: UIImage? 

The image to place next to the actions title.


public var imageSide: LateralDirection


public var style: Style

The style that is applied to the action's button.


public var isEnabled: Bool = true

A boolean value indicating whether the action is currently enabled.

The default value of this property is true. Changing the value to false causes the action to appear dimmed in the resulting dialog. When an action is disabled, taps on the corresponding button have no effect.