Queries and reevaluates the currently focused item.


class UIFocusSystem : NSObject


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.


Creating a Focus System Object

init?(for: UIFocusEnvironment)

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

Getting the Currently Focused Item

var focusedItem: UIFocusItem?

The item that is currently focused.

Managing Focus Updates

func requestFocusUpdate(to: UIFocusEnvironment)

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

func updateFocusIfNeeded()

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

Registering Custom Sounds

class func register(URL, forSoundIdentifier: UIFocusSoundIdentifier)

Registers the specified sound file with the focus engine.

Responding to Focus-Related Keys and Notifications


Inherits From

Conforms To

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.

protocol UIFocusEnvironment

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

class UIFocusUpdateContext

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

protocol UIFocusItem

An object that can become focused.

class UIFocusMovementHint

Provides movement hint information for the focused item.

protocol UIFocusItemContainer

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

protocol UIFocusItemScrollableContainer

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