# Titanium.App.iOS.SceneProxy

> Proxy object representing a UIWindowScene in a multi-scene iOS application.

- Source: https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.SceneProxy
- Titanium SDK version: 14.0.0
- Kind: proxy
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 14.0.0
- Extends: Titanium.Proxy
- Inheritance: Titanium.Proxy

A SceneProxy provides access to a single UIWindowScene instance and its properties.
Scene proxies are obtained via [Titanium.App.iOS.currentScene](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#currentScene), [Titanium.App.iOS.scenes](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#scenes),
[Titanium.App.iOS.focusedScene](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#focusedScene), or the <Titanium.UI.Window.scene> property.

Multi-scene support is available on iOS 13 and later. The Titanium SDK includes
a default `UIApplicationSceneManifest` in the generated `Info.plist` with
`UIApplicationSupportsMultipleScenes` set to `true` and a single scene configuration
named "Default Configuration" with delegate class `TiApp`.

To add additional scene configurations (e.g., for CarPlay or custom window scenes),
add them under the `<ios><plist><dict>` section in your `tiapp.xml`:

    <ios>
        <plist>
            <dict>
                <key>UIApplicationSceneManifest</key>
                <dict>
                    <key>UIApplicationSupportsMultipleScenes</key>
                    <true/>
                    <key>UISceneConfigurations</key>
                    <dict>
                        <key>UIWindowSceneSessionRoleApplication</key>
                        <array>
                            <dict>
                                <key>UISceneConfigurationName</key>
                                [string](https://titaniumsdk.com/docs/sdk/Global.String.md)Default Configuration</string>
                                <key>UISceneDelegateClassName</key>
                                [string](https://titaniumsdk.com/docs/sdk/Global.String.md)TiApp</string>
                            </dict>
                        </array>
                    </dict>
                </dict>
            </dict>
        </plist>
    </ios>

In single-scene apps (iOS versions prior to 13.0 or apps without a scene manifest),
`currentScene` returns `null` and `scenes` returns an empty array.

### Example

``` js
// Get the current scene
var scene = Ti.App.iOS.currentScene;
Ti.API.info('Scene ID: ' + scene.sceneId);
Ti.API.info('Scene Name: ' + scene.sceneName);
Ti.API.info('Active: ' + scene.isActive);
Ti.API.info('Foreground: ' + scene.isForeground);
Ti.API.info('Primary: ' + scene.isPrimary);
Ti.API.info('Key (focused): ' + scene.isKey);

// Get trait collection info
var traits = scene.traitCollection;
Ti.API.info('UI Style: ' + traits.userInterfaceStyle);
Ti.API.info('Horizontal Size Class: ' + traits.horizontalSizeClass);
Ti.API.info('Vertical Size Class: ' + traits.verticalSizeClass);
```

## Properties

### id

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 14.0.0
- Permission: read-only

The unique identifier of the scene (alias for sceneId).

Convenience accessor that returns the same value as [Titanium.App.iOS.SceneProxy.sceneId](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.SceneProxy.md#sceneId).
This is the `persistentIdentifier` of the scene's `UISceneSession`.

### isActive

- Type: Boolean
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 14.0.0
- Permission: read-only

Whether the scene is currently active and receiving input.

Returns `true` when the scene is in the foreground and receiving events.
A scene becomes active when the [focus](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.SceneProxy.md#focus)
event fires and inactive when the [blur](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.SceneProxy.md#blur) fires.

### isForeground

- Type: Boolean
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 14.0.0
- Permission: read-only

Whether the scene is in the foreground (visible but may not be active).

Returns `true` when the scene is visible on screen, even if it is not
the active scene (for example, when a system overlay is shown on top of it).
A scene enters the foreground when the [resumed](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.SceneProxy.md#resumed)
event fires and enters the background when [paused](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.SceneProxy.md#paused) fires.

### isKey

- Type: Boolean
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 14.0.0
- Requires: iOS 13.0+
- Permission: read-only

Whether this scene's window is the one the user is currently interacting with.

Returns `true` when this scene's window was the last window to receive a touch event.
This is the most reliable way to determine which scene has input focus in
multi-scene mode (iPad Split View, Slide Over).

**Important:** In iPad Split View, both scenes report `isKeyWindow` as `true`
and `activationState` as `foregroundActive` simultaneously. The `isKey` property
uses hit-test tracking instead, making it a reliable focus indicator.

For the same information at the module level, use
[Titanium.App.iOS.focusedScene](https://titaniumsdk.com/docs/sdk/Titanium.App.iOS.md#focusedScene) which returns the focused scene proxy directly.

### isPrimary

- Type: Boolean
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 14.0.0
- Permission: read-only

Whether this scene is the primary (first) scene.

Returns `true` for the scene that was launched first or is designated as
the primary scene in the scene configuration.

### sceneId

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 14.0.0
- Permission: read-only

The unique identifier of the scene.

The `persistentIdentifier` of the scene's `UISceneSession`.
This value uniquely identifies the scene across its lifetime.

### sceneName

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 14.0.0
- Permission: read-only

The configuration name of the scene.

The name of the `UISceneConfiguration` used to create this scene.
Defaults to "Default Configuration" if no custom name is set.

### traitCollection

- Type: Dictionary
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 14.0.0
- Requires: iOS 13.0+
- Permission: read-only

The trait collection for this scene.

Returns a dictionary with the scene's `UITraitCollection` properties:

* `userInterfaceStyle` (Number): The user interface style. One of 0 (Unspecified), 1 (Light), or 2 (Dark).
* `horizontalSizeClass` (Number): The horizontal size class. One of 0 (Unspecified), 1 (Compact), or 2 (Regular).
* `verticalSizeClass` (Number): The vertical size class. One of 0 (Unspecified), 1 (Compact), or 2 (Regular).
* `displayScale` (Number): The display scale factor.
* `layoutDirection` (Number): The layout direction. One of 0 (Left to Right), 1 (Right to Left).

Returns `null` if the scene does not have a window or on iOS versions prior to 13.0.

### window

- Type: Titanium.UI.Window
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 14.0.0
- Permission: read-only

The root window proxy for this scene.

Returns the [Titanium.UI.Window](https://titaniumsdk.com/docs/sdk/Titanium.UI.Window.md) proxy for the root view controller of this scene.
Returns `null` if the scene does not have a window.

## Events

### blur

- Platforms: iPhone, iPad
- Since: Titanium SDK 14.0.0
- Requires: iOS 13.0+

Fired when this scene is about to resign the active state.

Fires when the scene is about to lose its active status, for example when a
system overlay (like the notification center) covers the scene or when the
user switches to another scene. This is the per-scene equivalent of the
legacy [pause](Titanium.App.iOS.pause) event and mirrors
[Titanium.UI.Window.blur](https://titaniumsdk.com/docs/sdk/Titanium.UI.Window.md#blur) at the scene level.

Add a listener via `scene.addEventListener('blur', fn)`.

Event properties:

- `sceneId` (String): The unique identifier of the scene.
- `scene` (Titanium.App.iOS.SceneProxy): The scene proxy that is resigning active.

### focus

- Platforms: iPhone, iPad
- Since: Titanium SDK 14.0.0
- Requires: iOS 13.0+

Fired when this scene becomes active and can receive user input.

Fires when the scene transitions to the active state, meaning it is in the
foreground and receiving user input events. This is the per-scene equivalent
of the legacy [resumed](Titanium.App.iOS.resumed) event and mirrors
[Titanium.UI.Window.focus](https://titaniumsdk.com/docs/sdk/Titanium.UI.Window.md#focus) at the scene level.

Add a listener via `scene.addEventListener('focus', fn)`. The
listener fires only for this scene, not for other scenes in the app.

Event properties:

- `sceneId` (String): The unique identifier of the scene.
- `scene` (Titanium.App.iOS.SceneProxy): The scene proxy that became active.

### paused

- Platforms: iPhone, iPad
- Since: Titanium SDK 14.0.0
- Requires: iOS 13.0+

Fired when this scene has entered the background.

Fires when the scene is no longer visible on screen. This can happen when
the user switches to another app or when the scene is dismissed. This is
the per-scene equivalent of the legacy [paused](Titanium.App.iOS.paused)
event.

Add a listener via `scene.addEventListener('paused', fn)`.

Event properties:

- `sceneId` (String): The unique identifier of the scene.
- `scene` (Titanium.App.iOS.SceneProxy): The scene proxy that entered the background.

### resumed

- Platforms: iPhone, iPad
- Since: Titanium SDK 14.0.0
- Requires: iOS 13.0+

Fired when this scene is about to enter the foreground.

Fires when the scene transitions from the background to the foreground,
meaning it becomes visible on screen but may not yet be active. This is
the per-scene equivalent of the legacy [resume](Titanium.App.iOS.resume)
event.

Add a listener via `scene.addEventListener('resumed', fn)`.

Event properties:

- `sceneId` (String): The unique identifier of the scene.
- `scene` (Titanium.App.iOS.SceneProxy): The scene proxy that is entering the foreground.

## Inherited members

6 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`

---

- 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`.

