<!--
{
  "availability" : [
    "tvOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIFocusEnvironment/soundIdentifierForFocusUpdate(in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UIFocusEnvironment(im)soundIdentifierForFocusUpdateInContext:"
  },
  "title" : "soundIdentifierForFocusUpdate(in:)"
}
-->

# soundIdentifierForFocusUpdate(in:)

Asks the delegate for the identifier of the sound to play when the object gains focus.

```
optional func soundIdentifierForFocusUpdate(in context: UIFocusUpdateContext) -> UIFocusSoundIdentifier?
```

## Parameters

`context`

The context object associated with the update.

## Return Value

The identifier of the sound to be played. Return `nil` if you want to let the parent focus environment determine which sound to play.

## Discussion

Use this method to return a custom sound when the focus environment object gains focus. Return [`default`](/documentation/UIKit/UIFocusSoundIdentifier/default) to play the default system sound, or return [`none`](/documentation/UIKit/UIFocusSoundIdentifier/none) to avoid playing a sound altogether. If you previously registered custom sounds using the [`register(_:forSoundIdentifier:)`](/documentation/UIKit/UIFocusSystem/register(_:forSoundIdentifier:)) method of [`UIFocusSystem`](/documentation/UIKit/UIFocusSystem), you may also return an identifier for a sound that you registered.

If you do not implement this method, the system assumes a `nil` return value. If no ancestor environment defines a custom sound, the system plays the [`default`](/documentation/UIKit/UIFocusSoundIdentifier/default) sound.

> Important:
> You must register custom sounds before returning the associated identifiers from this method. Returning an identifier that is unknown to UIKit will result in an assertion failure and an immediate crash.

---

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)