Skip to content
Titanium SDK
Version13.2.0

You are reading 13.2.0. See this page in 13.4.1.

Titanium.UI.iOS.PreviewAction

proxyiPhonesince 5.1.0

Extends Titanium.Proxy

A PreviewAction provides options to configure actions used by the iOS 9 3D-Touch "Peek and Pop" feature.

The PreviewAction is created by the Titanium.UI.iOS.createPreviewAction method. Set the title property when creating a PreviewAction object.

Use this class to configure preview actions used in the Titanium.UI.iOS.PreviewContext. The actions can also be part of the Titanium.UI.iOS.PreviewActionGroup.actions property.

For an example, see Titanium.UI.iOS.PreviewContext.

See also:

Properties 4

apiName

Stringsince Android 3.2.0, iPhone 3.2.0, iPad 3.2.0, macOS 9.2.0read-only

Inherited from Titanium.Proxy

The name of the API that this proxy corresponds to.

bubbleParent

Booleansince Android 3.0.0, iPhone 3.0.0, iPad 3.0.0, macOS 9.2.0

Inherited from Titanium.Proxy

Indicates if the proxy will bubble an event to its parent.

Default: true

Methods 4

Inherited from Titanium.Proxy

Adds the specified callback as an event listener for the named event.

Parameters
ParametersTypeDescription
nameString

Name of the event.

callbackCallback<Titanium.Event>

Callback function to invoke when the event is fired.

4 fields
bubbles Boolean

True if the event will try to bubble up if possible.

cancelBubble Boolean

Set to true to stop the event from bubbling.

source Object

Source object that fired the event.

type String

Name of the event fired.

Inherited from Titanium.Proxy

Fires a synthesized event to any registered listeners.

Parameters
ParametersTypeDescription
nameString

Name of the event.

event?Dictionary

A dictionary of keys and values to add to the Titanium.Event object sent to the listeners.

Inherited from Titanium.Proxy

Removes the specified callback as an event listener for the named event.

Parameters
ParametersTypeDescription
nameString

Name of the event.

callbackCallback<Titanium.Event>

Callback function to remove. Must be the same function passed to addEventListener.

4 fields
bubbles Boolean

True if the event will try to bubble up if possible.

cancelBubble Boolean

Set to true to stop the event from bubbling.

source Object

Source object that fired the event.

type String

Name of the event fired.

Events 1

Fired when the device detects a click against a preview action.

This event provides different properties depending on the view the Titanium.UI.iOS.PreviewContext is assigned to. Every event has the index property to identify the clicked action. If the Titanium.UI.iOS.PreviewContext is assigned to a Titanium.UI.ListView, the event provides the additional properties itemIndex, sectionIndex and itemId to identify the previewed row and section, respectively.

Event properties
Event propertiesTypeDescription
indexNumber

The index of the clicked action.

itemIndexNumber

The index of the clicked row, if the previewContext property of the Titanium.UI.iOS.PreviewContext is a Titanium.UI.ListView.

sectionIndexNumber

The index of the clicked section, if the previewContext property of the Titanium.UI.iOS.PreviewContext is a Titanium.UI.ListView.

itemIdString

The item ID of cell, if the previewContext property of the Titanium.UI.iOS.PreviewContext is a Titanium.UI.ListView.