<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSPresentationIntent/codeBlockIntentWithIdentity:languageHint:nestedInsideIntent:",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPresentationIntent(cm)codeBlockIntentWithIdentity:languageHint:nestedInsideIntent:"
  },
  "title" : "codeBlockIntentWithIdentity:languageHint:nestedInsideIntent:"
}
-->

# codeBlockIntentWithIdentity:languageHint:nestedInsideIntent:

Creates an code-block intent with the provided information.

```
+ (NSPresentationIntent *) codeBlockIntentWithIdentity:(NSInteger) identity languageHint:(NSString *) languageHint nestedInsideIntent:(NSPresentationIntent *) parent;
```

## Parameters

`identity`

The unique identifier for the intent.

`languageHint`

The programming language for the code listing.

`parent`

The parent intent of the code block.

## Return Value

A new intent with the kind set to [`NSPresentationIntentKindCodeBlock`](/documentation/Foundation/NSPresentationIntentKind/NSPresentationIntentKindCodeBlock).

---

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)