<div class="meta" robots="noindex">

</div>

Class

# iOSToolButton

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2020r2. Please use `MobileToolbarButton</api/user_interface/mobile/mobiletoolbarbutton>` as a replacement.

</div>

## Description

A button to add to a Toolbar or Navigation Bar on a View.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                             | Type                                 | Read-Only | Shared |
|----------------------------------|--------------------------------------|-----------|--------|
| `Caption<iostoolbutton.caption>` | `Text</api/deprecated/text>`         |           |        |
| `Enabled<iostoolbutton.enabled>` | `Boolean</api/data_types/boolean>`   |           |        |
| `Image<iostoolbutton.image>`     | `iOSImage</api/deprecated/iosimage>` |           |        |
| `Tag<iostoolbutton.tag>`         | `Auto</api/deprecated/auto>`         |           |        |
| `Type<iostoolbutton.type>`       | `Types<iostoolbutton.types>`         |           |        |
| `Width<iostoolbutton.width>`     | `Double</api/data_types/double>`     |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                         | Parameters                                                                                                                                  | Returns                                     | Shared |
|----------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------|--------|
| `Constructor<iostoolbutton.constructor0>`    | type As iOSToolButton, title As `String</api/data_types/string>` = "", image As `Picture</api/graphics/picture>` = `Nil</api/language/nil>` |                                             |        |
| `FixedSpace<iostoolbutton.fixedspace>`       |                                                                                                                                             | iOSToolButton                               |        |
| `FlexibleSpace<iostoolbutton.flexiblespace>` |                                                                                                                                             | iOSToolButton                               |        |
| `Handle<iostoolbutton.handle>`               |                                                                                                                                             | `Ptr</api/data_types/additional_types/ptr>` |        |
| `NewFromHandle<iostoolbutton.newfromhandle>` | handle As `Ptr</api/data_types/additional_types/ptr>`                                                                                       | iOSToolButton                               |        |
| `NewSystemItem<iostoolbutton.newsystemitem>` | type As iOSToolButton                                                                                                                       | iOSToolButton                               |        |

## Enumerations

<div id="iostoolbutton.types">

<div class="rst-class">

forsearch

</div>

</div>

iOSToolButton.Types

### Types

System icons to use when creating buttons using NewSystemItem.

| Enum                | Description                                                                                                                                        |
|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|
| SystemAction        | Uses system icon to indicate an action.                                                                                                            |
| SystemAdd           | Uses system icon to indicate an add.                                                                                                               |
| SystemBookmarks     | Uses system icon to indicate a bookmark.                                                                                                           |
| SystemCamera        | Uses system icon to indicate the camera.                                                                                                           |
| SystemCancel        | Uses localized text for "Cancel".                                                                                                                  |
| SystemCompose       | Uses system icon to indicate a new document.                                                                                                       |
| SystemDone          | Uses localized text for "Done".                                                                                                                    |
| SystemEdit          | Uses localized text for "Edit".                                                                                                                    |
| SystemFastForward   | Uses system fast forward icon.                                                                                                                     |
| SystemFixedSpace    | Adds a fixed space for separating icons.                                                                                                           |
| SystemFlexibleSpace | A flexible space that pushes icons on the right all the way to the right edge of the toolbar.                                                      |
| SystemOrganize      | Uses system icon.                                                                                                                                  |
| SystemPageCurl      | This bar button image can be used only for bar button items placed on toolbars. This type is not recommended for apps that run in iOS 7 and later. |
| SystemPause         | Uses system icon.                                                                                                                                  |
| SystemPlay          | Uses system icon.                                                                                                                                  |
| SystemRedo          | Uses localized text for "Redo".                                                                                                                    |
| SystemRefresh       | Uses system icon.                                                                                                                                  |
| SystemReply         | Uses system icon.                                                                                                                                  |
| SystemRewind        | Uses system icon.                                                                                                                                  |
| SystemSave          | Uses localized text for "Save".                                                                                                                    |
| SystemSearch        | Uses system icon.                                                                                                                                  |
| SystemStop          | Uses system icon.                                                                                                                                  |
| SystemTrash         | Uses system icon.                                                                                                                                  |
| SystemUndo          | Uses localized text for "Undo".                                                                                                                    |

## Property descriptions

<div id="iostoolbutton.caption">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSToolButton.Caption

**Caption** As `Text</api/deprecated/text>`

Sets the caption for the button. If you have both a Caption and Image specified, then only the Image appears.

<div id="iostoolbutton.enabled">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSToolButton.Enabled

**Enabled** As `Boolean</api/data_types/boolean>`

Enables or disables the button.

Add a disabled "Save" button to the toolbar:

``` xojo
Var saveButton As iOSToolbutton
saveButton = iOSToolButton.NewSystemItem(iOSToolbutton.Types.SystemSave)
saveButton.Enabled = False
Self.Toolbar.Add(saveButton)
```

<div id="iostoolbutton.image">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSToolButton.Image

**Image** As `iOSImage</api/deprecated/iosimage>`

Specifies an image to display for the button. If you have both a Caption and Image specified, then only the Image appears.

Only the mask for the image is used, displayed using the tint color for iOS (currently blue).

Refer to these topics in the Apple iOS Human Interface Guidelines: \* [Icon Sizes](https://developer.apple.com/library/prerelease/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html) \* [Bar Button Icons](https://developer.apple.com/library/prerelease/ios/documentation/UserExperience/Conceptual/MobileHIG/BarIcons.html#//apple_ref/doc/uid/TP40006556-CH21-SW1)

<div id="iostoolbutton.tag">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSToolButton.Tag

**Tag** As `Auto</api/deprecated/auto>`

A tag value.

<div id="iostoolbutton.type">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSToolButton.Type

**Type** As `Types<iostoolbutton.types>`

The button type.

<div id="iostoolbutton.width">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSToolButton.Width

**Width** As `Double</api/data_types/double>`

The button width.

## Method descriptions

<div id="iostoolbutton.constructor0">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSToolButton.Constructor

**Constructor**(type As iOSToolButton, title As `String</api/data_types/string>` = "", image As `Picture</api/graphics/picture>` = `Nil</api/language/nil>`)

<div class="note">

<div class="title">

Note

</div>

`Constructors</api/language/constructor>` are special methods called when you create an object with the `New</api/language/new>` keyword and pass in the parameters above.

</div>

Creates a button with the specified type, title or image.

Adds the SystemRefresh icon as a toolbar button:

``` xojo
Var tb As New iOSToolbutton(iOSToolbutton.Types.SystemRefresh)
Self.Toolbar.Add(tb)
```

<div id="iostoolbutton.fixedspace">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSToolButton.FixedSpace

**FixedSpace** As iOSToolButton

Creates a fixed space button.

Add a fixed space to separate buttons on a toolbar:

``` xojo
Self.Toolbar.Add(iOSToolButton.NewPlain("Save"))
Self.Toolbar.Add(iOSToolButton.FixedSpace)
Self.Toolbar.Add(iOSToolButton.NewPlain("Edit"))
```

<div id="iostoolbutton.flexiblespace">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSToolButton.FlexibleSpace

**FlexibleSpace** As iOSToolButton

Creates a flexible space button.

Add a flexible space to separate buttons:

``` xojo
Self.Toolbar.Add(iOSToolButton.NewPlain("Save"))
Self.Toolbar.Add(iOSToolButton.FlexibleSpace)
Self.Toolbar.Add(iOSToolButton.NewPlain("Reports"))
```

<div id="iostoolbutton.handle">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSToolButton.Handle

**Handle** As `Ptr</api/data_types/additional_types/ptr>`

Returns the iOS handle for use with Declares.

<div id="iostoolbutton.newfromhandle">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSToolButton.NewFromHandle

**NewFromHandle**(handle As `Ptr</api/data_types/additional_types/ptr>`) As iOSToolButton

Creates a button from an iOS handle to a toolbar button.

Used when creating buttons from Declares to Cocoa Touch.

<div id="iostoolbutton.newsystemitem">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSToolButton.NewSystemItem

**NewSystemItem**(type As iOSToolButton) As iOSToolButton

Creates a button using a built-in system item icon.

This code in the Open event handler of a view places an Add button in the left Navigation Bar:

``` xojo
' Create the button
Var button As iOSToolButton
button = iOSToolButton.NewSystemItem(iOSToolButton.Types.SystemAdd)

' Add it to the view
LeftNavigationToolbar.Add(button)
```

## Compatibility

iOS projects on the iOS operating system.

## See also

`Object</api/data_types/additional_types/object>` parent class; `MobileToolbar</api/user_interface/mobile/mobiletoolbar>`
