# Titanium.UI.iOS.MenuPopup

> A menu popup provides the ability to create custom tooltip options using the `items` property covering the native `UIMenuController` class. See also: * [iOS Developer Library: UIMenuController](https://developer.apple.com/documentation/uikit/uimenucontroller)

- Source: https://titaniumsdk.com/docs/sdk/12.8.0/Titanium.UI.iOS.MenuPopup
- Titanium SDK version: 12.8.0
- Kind: proxy
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK iPhone 5.2.0, iPad 5.2.0, macOS 9.2.0
- Extends: Titanium.Proxy
- Inheritance: Titanium.Proxy

## Example: Example using multiple `items` and a `click` event.

The example below creates a new menu popup and shows it when the user clicks on the button.

``` js
var win = Ti.UI.createWindow({
    backgroundColor: "#fff",
});

var button = Ti.UI.createButton({
    title: "Show options"
});

win.add(button);

var menu = Ti.UI.iOS.createMenuPopup({
    items: ["Option 1", "Option 2"]
});

menu.addEventListener("click", function(e) {
    alert(e);
});

button.addEventListener("click", function() {
    menu.show({
      view: button
    });
});

win.open();
```

## Properties

### items

- Type: Array<String>
- Platforms: iPhone, iPad, macOS

The items of the menu popup.

The items will be shown as soon in the menu popup when the `show` method is called.
To hide them again, use the `hide` method in conjunction.

## Methods

### hide

- Platforms: iPhone, iPad, macOS

Hides the menu popup.

Parameters:

- `options` (AnimatedOptions, optional): Includes options how the menu popup should be hidden. Introduced in SDK 5.2.0. Note that the default here is equivalent to passing in `{ animated: true }` (while typically the default for [AnimatedOptions](https://titaniumsdk.com/docs/sdk/AnimatedOptions.md) is false) Default: `{ animated: true }`.

### isVisible

- Platforms: iPhone, iPad, macOS

Indicates whether the menu popup is currently visible.

### show

- Platforms: iPhone, iPad, macOS

Shows the menu popup.

Parameters:

- `options` (MenuPopupShowParams): Includes options how the menu popup should be shown. Note that the default is to be animated.

## Events

### click

- Platforms: iPhone, iPad, macOS

Fired when the user clicks at one of the menu popup items.

This event provides the properties `title` and `index` which relate to the name and position
of the clicked item inside the `items` property.

Event properties:

- `index` (Number): The index of the clicked item.
- `title` (String): The title of the clicked item.

## Inherited members

6 members are inherited. Each is documented on the type that declares it.

- [Titanium.Proxy](https://titaniumsdk.com/docs/sdk/12.8.0/Titanium.Proxy.md): `addEventListener`, `apiName`, `applyProperties`, `bubbleParent`, `fireEvent`, `removeEventListener`

---

- This corpus documents Titanium SDK 13.4.1. Anything here that does not name a version describes 13.4.1.
- Titanium is maintained by TiDev. The Appcelerator toolchain is retired: there is no `appc` CLI, no Appcelerator Studio and no hosted build service. The supported CLI is `titanium` on npm, invoked as `ti`.

