Class

# iOSLayout

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

## Description

A layout that controls specific `Screens</api/user_interface/mobile/mobilescreen>` depending on the type of device being used.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                         | Type                                          | Read-Only | Shared |
|------------------------------|-----------------------------------------------|-----------|--------|
| `Content<ioslayout.content>` | `iOSLayoutContent</api/ios/ioslayoutcontent>` |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                       | Parameters | Returns                                     | Shared |
|----------------------------|------------|---------------------------------------------|--------|
| `Handle<ioslayout.handle>` |            | `Ptr</api/data_types/additional_types/ptr>` |        |

## Property descriptions

<div id="ioslayout.content">

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

</div>

<div class="rst-class">

forsearch

</div>

iOSLayout.Content

**Content** As `iOSLayoutContent</api/ios/ioslayoutcontent>`

> The content to display on the layout. This can be a single `Screen</api/user_interface/mobile/mobilescreen>`, an `iOSSplitView</api/ios/iossplitview>` (consisting of main and a detail `Screens</api/user_interface/mobile/mobilescreen>`) or an `iOSTabBar</api/ios/iostabbar>` (consisting of multiple `Screens</api/user_interface/mobile/mobilescreen>`).
>
> You can directly change the screen content without using `MobileScreen.Show<mobilescreen.show>`. This code creates a new `MobileScreen</api/user_interface/mobile/mobilescreen>` (Screen2, added to the project) and directly assigns it to the content:
>
> ``` xojo
> Var myNewScreen As New Screen2
> App.CurrentLayout.Content = myNewScreen
> ```

## Method descriptions

<div id="ioslayout.handle">

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

</div>

<div class="rst-class">

forsearch

</div>

iOSLayout.Handle

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

> A pointer to the screen handle for use with Declares.

## Notes

You cannot directly add controls to an <span class="title-ref">iOSLayout</span>. You add controls to `Screens</api/user_interface/mobile/mobilescreen>` and `Containers</api/user_interface/mobile/mobilecontainer>`.

An <span class="title-ref">iOSLayout</span> allows you to specify how your app looks depending on the type of device being used. For example, on an iPhone you can have your app display a single `MobileScreen</api/user_interface/mobile/mobilescreen>` that contains a Table with a list of items. To do this, in the Navigator, select the iPhoneLayout then in the Inspector, set the Content property to the `MobileScreen</api/user_interface/mobile/mobilescreen>` you wish to be your default. The iPhoneLayout is already set in the App Inspector as the default screen to use for an iPhone.

On an iPad, you may instead want to have a split screen with a list of items on the left and detail information on the right. You can do this by setting the Content property for the iPadLayout to be Split and then setting the Screens for the Main and Detail sections.

## Sample code

You can have multiple iOSLayouts in your project and switch them at runtime. To do so you use the `MobileApplication.CurrentLayout<mobileapplication.currentlayout>` property and change the content like this:

``` xojo
Var s As New MyLayout
App.CurrentLayout.Content = s.Content
```

## Compatibility

|                       |        |
|-----------------------|--------|
| **Project Types**     | Mobile |
| **Operating Systems** | iOS    |

<div class="seealso">

`Object</api/data_types/additional_types/object>` parent class; `iOSSplitView</api/ios/iossplitview>`, `iOSTabBar</api/ios/iostabbar>`, `MobileApplication</api/mobile/mobileapplication>` and `MobileScreen</api/user_interface/mobile/mobilescreen>` classes

</div>
