SwipeAction
public class SwipeAction: NSObject
The SwipeAction
object defines a single action to present when the user swipes horizontally in a table row.
This class lets you define one or more custom actions to display for a given row in your table. Each instance of this class represents a single action to perform and includes the text, formatting information, and behavior for the corresponding button.
-
An optional unique action identifier.
Declaration
Swift
public var identifier: String?
-
The title of the action button.
Note
You must specify a title or an image.Declaration
Swift
public var title: String?
-
The style applied to the action button.
Declaration
Swift
public var style: SwipeActionStyle
-
The object that is notified as transitioning occurs.
Declaration
Swift
public var transitionDelegate: SwipeActionTransitioning?
-
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?
-
The text color of the action button.
Note
If you do not specify a color, white is used.Declaration
Swift
public var textColor: UIColor?
-
The image used for the action button.
Note
You must specify a title or an image.Declaration
Swift
public var image: UIImage?
-
The highlighted image used for the action button.
Note
If you do not specify a highlight image, the defaultimage
is used for the highlighted state.Declaration
Swift
public var highlightedImage: UIImage?
-
The closure to execute when the user taps the button associated with this action.
Declaration
Swift
public var handler: ((SwipeAction, IndexPath) -> Void)?
-
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?
-
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?
-
A Boolean value that determines whether the actions menu is automatically hidden upon selection.
Note
When set totrue
, the actions menu is automatically hidden when the action is selected. The default value isfalse
.Declaration
Swift
public var hidesWhenSelected = false
-
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.