<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIFocusSystem",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIFocusSystem"
  },
  "title" : "UIFocusSystem"
}
-->

# UIFocusSystem

Queries and reevaluates the currently focused item.

```
@MainActor class UIFocusSystem
```

## Overview

Use a [`UIFocusSystem`](/documentation/UIKit/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`](/documentation/UIKit/UIFocusEnvironment) protocol. The [`UIFocusSystem`](/documentation/UIKit/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

### Getting a focus system object

[`init?(for: any UIFocusEnvironment)`](/documentation/UIKit/UIFocusSystem/init(for:))

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

### Getting the currently focused item

[`var focusedItem: (any UIFocusItem)?`](/documentation/UIKit/UIFocusSystem/focusedItem)

The item that’s currently focused.

### Managing focus updates

[`func requestFocusUpdate(to: any UIFocusEnvironment)`](/documentation/UIKit/UIFocusSystem/requestFocusUpdate(to:))

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

[`func updateFocusIfNeeded()`](/documentation/UIKit/UIFocusSystem/updateFocusIfNeeded())

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

### Checking the ancestry of the environment

[`+ (BOOL) environment:(id<UIFocusEnvironment>) environment containsEnvironment:(id<UIFocusEnvironment>) otherEnvironment;`](/documentation/UIKit/UIFocusSystem/environment:containsEnvironment:)

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

### Registering custom sounds

[`class func register(URL, forSoundIdentifier: UIFocusSoundIdentifier)`](/documentation/UIKit/UIFocusSystem/register(_:forSoundIdentifier:))

Registers the specified sound file with the focus engine.

### Responding to focus-related keys and notifications

[`class let animationCoordinatorUserInfoKey: String`](/documentation/UIKit/UIFocusSystem/animationCoordinatorUserInfoKey)

Updates the animation coordinator.

[`class let didUpdateNotification: NSNotification.Name`](/documentation/UIKit/UIFocusSystem/didUpdateNotification)

The focus for the UI has been updated.

[`class let focusUpdateContextUserInfoKey: String`](/documentation/UIKit/UIFocusSystem/focusUpdateContextUserInfoKey)

Updates the context key.

[`class let movementDidFailNotification: NSNotification.Name`](/documentation/UIKit/UIFocusSystem/movementDidFailNotification)

The focus failed to move to another item.

### Structures

[`struct DidUpdateMessage`](/documentation/UIKit/UIFocusSystem/DidUpdateMessage)

[`struct MovementDidFailMessage`](/documentation/UIKit/UIFocusSystem/MovementDidFailMessage)

### Initializers

[`init?(forEnvironment: any UIFocusEnvironment)`](/documentation/UIKit/UIFocusSystem/init(forEnvironment:))

### Type Methods

[`class func focusSystem(for: any UIFocusEnvironment) -> UIFocusSystem?`](/documentation/UIKit/UIFocusSystem/focusSystem(for:)-5htbd)

[`class func focusSystem(for: any UIFocusEnvironment) -> UIFocusSystem?`](/documentation/UIKit/UIFocusSystem/focusSystem(for:)-7tm2f)

## Relationships

### Conforms To

[`CVarArg`](/documentation/Swift/CVarArg)

[`Equatable`](/documentation/Swift/Equatable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Sendable`](/documentation/Swift/Sendable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)