<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MediaAccessibility",
  "identifier" : "/documentation/MediaAccessibility/MACaptionAppearanceExecuteBlockForProfileID(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Media Accessibility"
    ],
    "preciseIdentifier" : "c:@F@MACaptionAppearanceExecuteBlockForProfileID"
  },
  "title" : "MACaptionAppearanceExecuteBlockForProfileID(_:_:)"
}
-->

# MACaptionAppearanceExecuteBlockForProfileID(_:_:)

```
func MACaptionAppearanceExecuteBlockForProfileID(_ profileID: CFString, _ aBlock: @escaping () -> Void)
```

## Parameters

`profileID`

The profileID which will appear active when executing the block

`aBlock`

the block of code to execute

## Discussion

\abstract Executes a block of code as if the provided profileID was active. This is used in cases such as a need to get the fonts and colors of a profileID without changing the currently selected profileID.

---

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)