---
title: "mark(forStyle:at:)"
framework: InputMethodKit
role: symbol
role_heading: Instance Method
platforms: [macOS 10.5+]
path: "inputmethodkit/imkinputcontroller/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.

## Declaration

```swift
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

Return Value The dictionary of text attributes.

## Discussion

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:) 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 markedClauseSegment.

## See Also

### Working with Ranges

- [compositionAttributes(at:)](inputmethodkit/imkinputcontroller/compositionattributes(at:).md)
- [selectionRange()](inputmethodkit/imkinputcontroller/selectionrange().md)
- [replacementRange()](inputmethodkit/imkinputcontroller/replacementrange().md)
