Action Sheet API for iOS
Action sheet is a pop-up menu that consists of a list of options for a user to complete an action. It can also be used for notification dialog boxes or alert boxes. The Action Sheet API provides support for Apple's Action Sheets on iOS apps.
The process of implementing an Action Sheet involves two steps:
-
Creating an ActionSheet object.
-
Adding an item to the Action Sheet by creating an ActionItem object.
The Action Sheet API for iOS uses kony.ui Namespace
and the following API elements.
Function | Description |
---|---|
kony.ui.ActionItem
|
Constructs an ActionItem object for use in an ActionSheet object. |
kony.ui.ActionSheet
|
Constructs an ActionSheet object that represents an iOS Action Sheet. |
Property | Description |
---|---|
enable | Enables or disables the ActionItem object. |
Method | Description |
---|---|
addAction | Adds an ActionItem object to the ActionSheet object. |
Dismiss | Dismisses the Action Sheet on display. |
setAnchorConfiguration | Sets the anchor configuration information on iPads. |
show | Shows the Action Sheet on the display. |
To create an ActionSheet object, use the kony.ui.ActionSheet
function. Then add an item to the Action Sheet, create an ActionItem object by invoking the kony.ui.ActionItem
function. After you add an action item, the action sheet can be displayed by using the show
method. Each ActionItem object has a callback function that is automatically invoked whenever the user taps the Action Sheet choice represented by the ActionItem. The callback function processes the user's input as needed.
To view the functionality of the Action Sheet API in action, download the sample application from the link below. Once the application is downloaded, build and preview the application using the Quantum App.