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

</div>

Class

# iOSPicturePicker

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

<div class="warning">

<div class="title">

Warning

</div>

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

</div>

## Description

The <span class="title-ref">iOSPicturePicker</span> allows selection of an image stored on the device (or taken with the camera) for use in the app.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                      | Type                                        | Read-Only | Shared |
|-------------------------------------------|---------------------------------------------|-----------|--------|
| `Handle<iospicturepicker.handle>`         | `Ptr</api/data_types/additional_types/ptr>` | ✓         |        |
| `IsEditable<iospicturepicker.iseditable>` | `Boolean</api/data_types/boolean>`          |           |        |
| `Source<iospicturepicker.source>`         | `Sources<iospicturepicker.sources>`         |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                          | Parameters                                                            | Returns | Shared |
|-------------------------------|-----------------------------------------------------------------------|---------|--------|
| `Show<iospicturepicker.show>` | parentView As `MobileScreen</api/user_interface/mobile/mobilescreen>` |         |        |

## Events

<div class="rst-class">

table-centered_column_4

</div>

| Name                                    | Parameters                              | Returns |
|-----------------------------------------|-----------------------------------------|---------|
| `Cancelled<iospicturepicker.cancelled>` |                                         |         |
| `Selected<iospicturepicker.selected>`   | pic As `Picture</api/graphics/picture>` |         |

## Enumerations

<div id="iospicturepicker.sources">

<div class="rst-class">

forsearch

</div>

</div>

iOSPicturePicker.Sources

### Sources

These are the source locations from which the user can select a picture.

| Enum         | Description                                                                                                                                                                                                     |
|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Camera       | The user is prompted to take a picture with the camera. When running in the iOS Simulator an `UnsupportedOperationException</api/exceptions/unsupportedoperationexception>` is raised if you try to use Camera. |
| CameraRoll   | Lets the user choose from the pictures saved in the camera roll.                                                                                                                                                |
| PhotoLibrary | Lets the user choose a picture from anywhere on the device (albums, camera roll, etc).                                                                                                                          |

## Property descriptions

<div id="iospicturepicker.handle">

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

</div>

<div class="rst-class">

forsearch

</div>

iOSPicturePicker.Handle

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

Used for creating Declares to the underlying UIImagePickerController.

This property is read-only.

<div id="iospicturepicker.iseditable">

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

</div>

<div class="rst-class">

forsearch

</div>

iOSPicturePicker.IsEditable

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

Indicates if the user can edit the picture in the picker.

Display a picture picker that lets the user edit the picture they select:

``` xojo
MyPicPicker.IsEditable = True
MyPicPicker.Source = iOSPicturePicker.Sources.CameraRoll
MyPicPicker.Show
```

<div id="iospicturepicker.source">

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

</div>

<div class="rst-class">

forsearch

</div>

iOSPicturePicker.Source

**Source** As `Sources<iospicturepicker.sources>`

Uses the Sources enumeration to specify the source for the pictures to select from.

Prompt the user to take a picture:

``` xojo
MyPicPicker.Source = iOSPicturePicker.Sources.Camera
MyPicPicker.Show
```

## Method descriptions

<div id="iospicturepicker.show">

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

</div>

<div class="rst-class">

forsearch

</div>

iOSPicturePicker.Show

**Show**(parentView As `MobileScreen</api/user_interface/mobile/mobilescreen>`)

Displays the picture picker.

This is not modal so your code continues running after calling Show. The Cancelled and Selected events are called based on the user's action.

Display the picture picker:

``` xojo
MyPicPicker.Show(Self)
```

## Event descriptions

<div id="iospicturepicker.cancelled">

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

</div>

<div class="rst-class">

forsearch

</div>

iOSPicturePicker.Cancelled

**Cancelled**

The user cancelled the picking operation.

<div id="iospicturepicker.selected">

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

</div>

<div class="rst-class">

forsearch

</div>

iOSPicturePicker.Selected

**Selected**(pic As `Picture</api/graphics/picture>`)

Called when a picture is selected. pic is an iOSBitmap that can then be used by the app.

Display the selected picture:

``` xojo
MyImageView.Image = pic
```

## Notes

2018r3 and later automatically add the NSCameraUsageDescription key to the plist.

If your source is set to Sources.Camera and you're using an earlier version of Xojo, then you will also need to add a plist entry to tell iOS to allow camera access.

``` xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>NSCameraUsageDescription</key>
    <string>Allow user to access the camera.</string>
</dict>
</plist>
```

## Compatibility

iOS projects on the iOS operating system.

## See also

`Object</api/data_types/additional_types/object>` parent class; `Picture</api/graphics/picture>`, `Picture</api/graphics/picture>` classes
