Back to Swipecellkit

SwipeAction

docs/docsets/SwipeCellKit.docset/Contents/Resources/Documents/Classes/SwipeAction.html

2.7.15.3 KB
Original Source

SwipeAction

public class SwipeAction: NSObject

The SwipeAction object defines a single action to present when the user swipes horizontally in a table/collection item.

This class lets you define one or more custom actions to display for a given item in your table/collection. Each instance of this class represents a single action to perform and includes the text, formatting information, and behavior for the corresponding button.

`

                identifier
                `

An optional unique action identifier.

Declaration

Swift

public var identifier: String?

`

                title
                `

The title of the action button.

Note

You must specify a title or an image.

Declaration

Swift

public var title: String?

`

                style
                `

The style applied to the action button.

Declaration

Swift

public var style: SwipeActionStyle

`

                transitionDelegate
                `

The object that is notified as transitioning occurs.

Declaration

Swift

public var transitionDelegate: SwipeActionTransitioning?

`

                font
                `

The font to use for the title of the action button.

Note

If you do not specify a font, a 15pt system font is used.

Declaration

Swift

public var font: UIFont?

`

                textColor
                `

The text color of the action button.

Note

If you do not specify a color, white is used.

Declaration

Swift

public var textColor: UIColor?

`

                highlightedTextColor
                `

The highlighted text color of the action button.

Note

If you do not specify a color, textColor is used.

Declaration

Swift

public var highlightedTextColor: UIColor?

`

                image
                `

The image used for the action button.

Note

You must specify a title or an image.

Declaration

Swift

public var image: UIImage?

`

                highlightedImage
                `

The highlighted image used for the action button.

Note

If you do not specify a highlight image, the default image is used for the highlighted state.

Declaration

Swift

public var highlightedImage: UIImage?

`

                handler
                `

The closure to execute when the user taps the button associated with this action.

Declaration

Swift

public var handler: ((SwipeAction, IndexPath) -> Void)?

`

                backgroundColor
                `

The background color of the action button.

Note

Use this property to specify the background color for your button. If you do not specify a value for this property, the framework assigns a default color based on the value in the style property.

Declaration

Swift

public var backgroundColor: UIColor?

`

                highlightedBackgroundColor
                `

The highlighted background color of the action button.

Note

Use this property to specify the highlighted background color for your button.

Declaration

Swift

public var highlightedBackgroundColor: UIColor?

`

                backgroundEffect
                `

The visual effect to apply to the action button.

Note

Assigning a visual effect object to this property adds that effect to the background of the action button.

Declaration

Swift

public var backgroundEffect: UIVisualEffect?

`

                hidesWhenSelected
                `

A Boolean value that determines whether the actions menu is automatically hidden upon selection.

Note

When set to true, the actions menu is automatically hidden when the action is selected. The default value is false.

Declaration

Swift

public var hidesWhenSelected = false

`

                init(style:title:handler:)
                `

Constructs a new SwipeAction instance.

Declaration

Swift

public init(style: SwipeActionStyle, title: String?, handler: ((SwipeAction, IndexPath) -> Void)?)

Parameters

| style |

The style of the action button.

| | title |

The title of the action button.

| | handler |

The closure to execute when the user taps the button associated with this action.

|

`

                fulfill(with:)
                `

Calling this method performs the configured expansion completion animation including deletion, if necessary. Calling this method more than once has no effect.

You should only call this method from the implementation of your action handler method.

Declaration

Swift

public func fulfill(with style: ExpansionFulfillmentStyle)

Parameters

| style |

The desired style for completing the expansion action.

|

© 2018 Mohammad Kurabi. All rights reserved. (Last updated: 2018-05-26)

Generated by jazzy ♪♫ v0.8.4, a Realm project.