<!--
{
  "availability" : [
    "macOS: 10.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "InputMethodKit",
  "identifier" : "/documentation/InputMethodKit/IMKInputController/mark(forStyle:at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "InputMethodKit"
    ],
    "preciseIdentifier" : "c:objc(cs)IMKInputController(im)markForStyle:atRange:"
  },
  "title" : "mark(forStyle:at:)"
}
-->

# mark(forStyle:at:)

Returns a dictionary of text attributes that can mark a range of an attributed string to send to a client.

```
func mark(forStyle style: Int, at range: NSRange) -> [AnyHashable : Any]!
```

## Parameters

`style`

A style, which should be one of the following values: <doc://com.apple.documentation/documentation/coreservices/ktsmhiliteselectedrawtext>, <doc://com.apple.documentation/documentation/coreservices/ktsmhiliteconvertedtext>, or <doc://com.apple.documentation/documentation/coreservices/ktsmhiliteselectedconvertedtext>. See the `AERegistry.h` header file for the definition of these values.

`range`

The range (that is, a clause) to mark.

## Return Value

The dictionary of text attributes.

## Discussion

This utility function can be called by input methods to mark each range (i.e. clause ) of marked text. T

The default implementation first calls the method [`compositionAttributes(at:)`](/documentation/InputMethodKit/IMKInputController/compositionAttributes(at:)) to obtain the additional attributes that an input method wants to include, such as font or glyph information. Then, it adds the appropriate underline and underline color information to the attributes dictionary for the style parameter. Finally it adds the style value as the dictionary value. The key for the style value is <doc://com.apple.documentation/documentation/Foundation/NSAttributedString/Key/markedClauseSegment>.

---

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)