Class

UIFocusSystem

Queries and reevaluates the currently focused item.

Declaration

@interface UIFocusSystem : NSObject

Overview

Use a UIFocusSystem object to obtain the focus-related state for the objects of your app. You can get state information for your app's views, view controllers, windows, and other objects that adopt the UIFocusEnvironment protocol. The UIFocusSystem object lists the currently focused item, if any, for a window or view hierarchy. You can use it to force the system to update the focus state, and you can register custom sounds to be played during focus changes.

Topics

Creating a Focus System Object

+ focusSystemForEnvironment:

Retrieves a focus system object that contains the state information for the specified object.

Getting the Currently Focused Item

focusedItem

The item that is currently focused.

Managing Focus Updates

- requestFocusUpdateToEnvironment:

Submits a request to update the focus state of the specified object.

- updateFocusIfNeeded

Forces the system to act on a pending focus update for the current environment.

Checking the Ancestry of the Environment

+ environment:containsEnvironment:

Returns a Boolean value indicating whether one focus environment is contained by another.

Registering Custom Sounds

+ registerURL:forSoundIdentifier:

Registers the specified sound file with the focus engine.

Responding to Focus-Related Keys and Notifications

UIFocusUpdateAnimationCoordinatorKey

Updates the animation coordinator.

UIFocusDidUpdateNotification

The focus for the UI has been updated.

UIFocusUpdateContextKey

Updates the context key.

UIFocusMovementDidFailNotification

The focus failed to move to another item.

Relationships

Inherits From

See Also

Focus Interactions

About Focus Interactions for Apple TV

Design and implement intuitive control schemes for menus and interactive user interface layouts.

Adding User-Focusable Elements to a tvOS App

Create intuitive and easily manipulated user-interactive controls for your tvOS app.

UIFocusEnvironment

A set of methods that define the focus behavior for a branch of the view hierarchy.

UIFocusUpdateContext

An object that provides information relevant to a specific focus update from one view to another.

UIFocusItem

An object that can become focused.

UIFocusMovementHint

Provides movement hint information for the focused item.

UIFocusItemContainer

The container responsible for providing geometric context to focus items within a given focus environment.

UIFocusItemScrollableContainer

A type of focus item container that supports automatic scrolling of focusable content.