# Titanium.UI.iOS.SplitWindow

> A SplitWindow is a window that manages the presentation of two side-by-side view controllers.

- Source: https://titaniumsdk.com/docs/sdk/Titanium.UI.iOS.SplitWindow
- Titanium SDK version: 14.0.0
- Kind: view
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK iPhone 3.6.0, iPad 3.6.0, macOS 9.2.0
- Extends: Titanium.UI.Window
- Inheritance: Titanium.UI.Window > Titanium.UI.View > Titanium.Proxy

The [masterView](https://titaniumsdk.com/docs/sdk/Titanium.UI.iOS.SplitWindow.md#masterView) and [detailView](https://titaniumsdk.com/docs/sdk/Titanium.UI.iOS.SplitWindow.md#detailView)
properties are required before the SplitWindow is opened.

You use this class to implement a master-detail interface, in which the left-side view presents
a list of items and the right-side presents details of the selected item. The `SplitWindow` is supported
for both iPhone and iPad idioms. Use the [Titanium.UI.iOS.createSplitWindow](https://titaniumsdk.com/docs/sdk/Titanium.UI.iOS.md#createSplitWindow) method to create a `SplitWindow` object.

The `SplitWindow` is backed by the native `UISplitViewController` and uses its default behavior:

* In a wide regular width, such as an iPad in landscape, the master view and the detail view are shown side by side.
* In a narrower regular width, such as an iPad in portrait, the master view is hidden. The display mode button in the
  navigation bar of the detail view and a swipe from the leading edge show it as an overlay.
* In a compact width, such as an iPhone in portrait, the split window collapses to a single column and the system
  navigates between the master view and the detail view.

Use [displayMode](https://titaniumsdk.com/docs/sdk/Titanium.UI.iOS.SplitWindow.md#displayMode) and [splitBehavior](https://titaniumsdk.com/docs/sdk/Titanium.UI.iOS.SplitWindow.md#splitBehavior)
to request a different arrangement, [showMasterView](https://titaniumsdk.com/docs/sdk/Titanium.UI.iOS.SplitWindow.md#showMasterView) and
[hideMasterView](https://titaniumsdk.com/docs/sdk/Titanium.UI.iOS.SplitWindow.md#hideMasterView) to show or hide the master view, and
[primaryColumnWidthFraction](https://titaniumsdk.com/docs/sdk/Titanium.UI.iOS.SplitWindow.md#primaryColumnWidthFraction) to control its width.

The system embeds each view in a navigation controller, so the `title` and the navigation bar properties of a
[Titanium.UI.Window](https://titaniumsdk.com/docs/sdk/Titanium.UI.Window.md) apply directly. Set `navBarHidden` to `true` on a window to hide its navigation bar. Use a
[Titanium.UI.NavigationWindow](https://titaniumsdk.com/docs/sdk/Titanium.UI.NavigationWindow.md) as `masterView` or `detailView` to push windows inside a pane.

The SplitWindow is a top-level window and cannot be contained within another window or view.

## Properties

### detailView

- Type: Titanium.UI.Window
- Platforms: iPhone, iPad, macOS

Window for the detail view section of the SplitWindow.

### displayMode

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 14.0.0
- Default: `<Titanium.UI.iOS.SPLIT_WINDOW_DISPLAY_MODE_AUTOMATIC>`

The arrangement of the master view and the detail view.

Set one of the `SPLIT_WINDOW_DISPLAY_MODE_*` constants to request a display mode. The system applies the mode when
the width allows it. Reading the property returns the display mode in use, which can differ from the requested
one, for example in a compact width where the split window is collapsed.

Accepts: `Titanium.UI.iOS.SPLIT_WINDOW_DISPLAY_MODE_AUTOMATIC`, `Titanium.UI.iOS.SPLIT_WINDOW_DISPLAY_MODE_ONE_BESIDE_SECONDARY`, `Titanium.UI.iOS.SPLIT_WINDOW_DISPLAY_MODE_ONE_OVER_SECONDARY`, `Titanium.UI.iOS.SPLIT_WINDOW_DISPLAY_MODE_SECONDARY_ONLY`

### landscapeSplit

- Type: Number
- Platforms: iPhone, iPad, macOS
- Default: `The width of the master-view divided by the screen-height`
- DEPRECATED since 14.0.0. The layout is owned by the system and this property has no effect. Use <Titanium.UI.iOS.SplitWindow.primaryColumnWidthFraction>.

Determines the width of the `masterView` in landscape mode.

### masterIsOverlayed

- Type: Boolean
- Platforms: iPhone, iPad, macOS
- Default: `false`
- DEPRECATED since 14.0.0. The layout is owned by the system and this property has no effect. Use <Titanium.UI.iOS.SplitWindow.splitBehavior> with <Titanium.UI.iOS.SPLIT_WINDOW_SPLIT_BEHAVIOR_OVERLAY>.

Determines whether to show the master view is overlayed in portrait orientation.

### masterView

- Type: Titanium.UI.Window
- Platforms: iPhone, iPad, macOS

Window for the master view section of the SplitWindow.

### masterViewVisible

- Type: Boolean
- Platforms: iPhone, iPad, macOS
- Default: `true`
- DEPRECATED since 14.0.0. The layout is owned by the system and this property has no effect. Use <Titanium.UI.iOS.SplitWindow.showMasterView> and <Titanium.UI.iOS.SplitWindow.hideMasterView>.

Determines whether to show the master view or hide.

### maximumPrimaryColumnWidth

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 14.0.0
- Default: `System default`

The maximum width of the master view in points.

### minimumPrimaryColumnWidth

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 14.0.0
- Default: `System default`

The minimum width of the master view in points.

### portraitSplit

- Type: Number
- Platforms: iPhone, iPad, macOS
- Default: `The width of the master-view divided by the screen-width`
- DEPRECATED since 14.0.0. The layout is owned by the system and this property has no effect. Use <Titanium.UI.iOS.SplitWindow.primaryColumnWidthFraction>.

Determines the width of the `masterView` in portrait mode.

### presentsWithGesture

- Type: Boolean
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 14.0.0
- Default: `true`

Determines whether a swipe from the leading edge shows the hidden master view.

### primaryColumnWidthFraction

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 14.0.0
- Default: `System default`

The width of the master view as a fraction of the width of the split window.

The resulting width is limited by [minimumPrimaryColumnWidth](https://titaniumsdk.com/docs/sdk/Titanium.UI.iOS.SplitWindow.md#minimumPrimaryColumnWidth)
and [maximumPrimaryColumnWidth](https://titaniumsdk.com/docs/sdk/Titanium.UI.iOS.SplitWindow.md#maximumPrimaryColumnWidth).

### showMasterInPortrait

- Type: Boolean
- Platforms: iPhone, iPad, macOS
- Default: `false`
- DEPRECATED since 14.0.0. The layout is owned by the system and this property has no effect. Use <Titanium.UI.iOS.SplitWindow.displayMode> with <Titanium.UI.iOS.SPLIT_WINDOW_DISPLAY_MODE_ONE_BESIDE_SECONDARY> to always show the master view.

Determines whether to show the master view in portrait orientation.

### splitBehavior

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 14.0.0
- Default: `<Titanium.UI.iOS.SPLIT_WINDOW_SPLIT_BEHAVIOR_AUTOMATIC>`

How the master view and the detail view share the width when both are visible.

Set one of the `SPLIT_WINDOW_SPLIT_BEHAVIOR_*` constants to request a split behavior. Reading the property returns
the split behavior in use, which can differ from the requested one.

Accepts: `Titanium.UI.iOS.SPLIT_WINDOW_SPLIT_BEHAVIOR_AUTOMATIC`, `Titanium.UI.iOS.SPLIT_WINDOW_SPLIT_BEHAVIOR_DISPLACE`, `Titanium.UI.iOS.SPLIT_WINDOW_SPLIT_BEHAVIOR_OVERLAY`, `Titanium.UI.iOS.SPLIT_WINDOW_SPLIT_BEHAVIOR_TILE`

## Methods

### hideMasterView

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 14.0.0

Hides the master view if the current display mode shows it.

The system animates the change. Listen to the [displaymodechange](https://titaniumsdk.com/docs/sdk/Titanium.UI.iOS.SplitWindow.md#displaymodechange)
event to react to the result.

### setMasterIsOverlayed

- Platforms: iPhone, iPad, macOS
- DEPRECATED since 14.0.0. The layout is owned by the system. Use <Titanium.UI.iOS.SplitWindow.splitBehavior> instead.

Sets the value of the [masterIsOverlayed](https://titaniumsdk.com/docs/sdk/Titanium.UI.iOS.SplitWindow.md#masterIsOverlayed) property.

Parameters:

- `masterIsOverlayed` (Boolean): Determines whether to show the master view is overlayed in portrait orientation.
- `options` (AnimatedOptions, optional): Ignored. Default: `{ animated: false }`.

### setShowMasterInPortrait

- Platforms: iPhone, iPad, macOS
- DEPRECATED since 14.0.0. The layout is owned by the system. Use <Titanium.UI.iOS.SplitWindow.displayMode> instead.

Sets the value of the [showMasterInPortrait](https://titaniumsdk.com/docs/sdk/Titanium.UI.iOS.SplitWindow.md#showMasterInPortrait) property.

Parameters:

- `showMasterInPortrait` (Boolean): Determines whether to show the master view in portrait orientation.
- `options` (AnimatedOptions, optional): Ignored. Default: `{ animated: false }`.

### showMasterView

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 14.0.0

Shows the master view if the current display mode hides it.

The system animates the change and picks the display mode that fits the available width, for example an
overlay in a narrow width. Listen to the [displaymodechange](https://titaniumsdk.com/docs/sdk/Titanium.UI.iOS.SplitWindow.md#displaymodechange)
event to react to the result.

## Events

### collapse

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 14.0.0

Fired when the split window collapses to a single column, for example when the width becomes compact.

### displaymodechange

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 14.0.0

Fired before the split window changes its display mode, for example when the master view is shown or hidden.

Event properties:

- `displayMode` (Number): The new display mode.

### expand

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 14.0.0

Fired when the split window expands from a single column to two columns.

## Inherited members

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

- [Titanium.Proxy](https://titaniumsdk.com/docs/sdk/Titanium.Proxy.md): `addEventListener`, `apiName`, `applyProperties`, `bubbleParent`, `fireEvent`, `removeEventListener`
- [Titanium.UI.View](https://titaniumsdk.com/docs/sdk/Titanium.UI.View.md): `accessibilityHidden`, `accessibilityHint`, `accessibilityLabel`, `accessibilityValue`, `add`, `anchorPoint`, `animate`, `animatedCenter`, `backgroundGradient`, `backgroundImage`, `backgroundLeftCap`, `backgroundRepeat`, `backgroundSelectedColor`, `backgroundTopCap`, `borderColor`, `borderDashPattern`, `borderRadius`, `borderWidth`, `center`, `children`, `clearMotionEffects`, `click`, `clipMode`, `convertPointToView`, `dblclick`, `doubletap`, `getViewById`, `height`, `hide`, `horizontalMotionEffect`, `horizontalWrap`, `id`, `insertAt`, `keypressed`, `layout`, `longpress`, `pinch`, `postlayout`, `previewContext`, `pullBackgroundColor`, `rect`, `remove`, `replaceAt`, `rotate`, `rotation`, `show`, `singletap`, `size`, `swipe`, `tintColor`, `toImage`, `tooltip`, `touchEnabled`, `touchcancel`, `touchend`, `touchmove`, `touchstart`, `transform`, `twofingertap`, `verticalMotionEffect`, `viewShadowColor`, `viewShadowOffset`, `viewShadowRadius`, `visible`, `width`, `zIndex`
- [Titanium.UI.Window](https://titaniumsdk.com/docs/sdk/Titanium.UI.Window.md): `autoAdjustScrollViewInsets`, `backButtonTitle`, `backButtonTitleImage`, `backgroundColor`, `barColor`, `barImage`, `blur`, `bottom`, `close`, `close`, `closed`, `extendEdges`, `extendSafeArea`, `focus`, `focused`, `fullscreen`, `hideNavBar`, `hideShadow`, `hideTabBar`, `hideToolbar`, `hidesBackButton`, `hidesBarsOnSwipe`, `hidesBarsOnTap`, `hidesBarsWhenKeyboardAppears`, `hidesSearchBarWhenScrolling`, `homeIndicatorAutoHidden`, `includeOpaqueBars`, `largeTitleDisplayMode`, `largeTitleEnabled`, `left`, `leftNavButton`, `leftNavButtons`, `modal`, `navBarHidden`, `navTintColor`, `navigationWindow`, `opacity`, `open`, `open`, `orientation`, `orientationModes`, `reservedRegions`, `reservedregionschange`, `right`, `rightNavButton`, `rightNavButtons`, `safeAreaPadding`, `shadowImage`, `showNavBar`, `showTabBar`, `showToolbar`, `statusBarStyle`, `tabBarHidden`, `title`, `titleAttributes`, `titleControl`, `titleImage`, `titlePrompt`, `titleid`, `titlepromptid`, `toolbar`, `top`, `translucent`

---

- This corpus documents Titanium SDK 14.0.0. Anything here that does not name a version describes 14.0.0.
- 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`.

