---
title: ObjectiveCConvertibleAttributedStringKey
framework: foundation
role: symbol
role_heading: Protocol
path: foundation/objectivecconvertibleattributedstringkey
---

# ObjectiveCConvertibleAttributedStringKey

A protocol that defines Objective-C interoperability with an attribute key’s value type.

## Declaration

```swift
protocol ObjectiveCConvertibleAttributedStringKey : AttributedStringKey
```

## Overview

Overview Conform to this protocol to allow your attributed string key to customize its Objective-C conversion behavior. This allows you to define an Objective-C value type and provide methods to convert to and from this type. Attributed string keys that don’t conform to this protocol cast the value to AnyObject before converting to Objective-C. When converting from Objective-C, the value casts to the key’s Value type. In cases where Swift types bridge automatically to Objective-C types, like String to NSString, this default behavior is adequate. But for unbridged value types, you need to conform to this protocol and provide the conversion methods.

## Topics

### Accessing the Objective-C Type

- [ObjectiveCValue](foundation/objectivecconvertibleattributedstringkey/objectivecvalue.md)

### Converting between Swift and Objective-C Types

- [objectiveCValue(for:)](foundation/objectivecconvertibleattributedstringkey/objectivecvalue(for:).md)
- [value(for:)](foundation/objectivecconvertibleattributedstringkey/value(for:).md)

## Relationships

### Inherits From

- [AttributedStringKey](foundation/attributedstringkey.md)
- [SendableMetatype](swift/sendablemetatype.md)

### Conforming Types

- [AttributeScopes.AccessibilityAttributes.AdjustedPitchAttribute](foundation/attributescopes/accessibilityattributes/adjustedpitchattribute.md)
- [AttributeScopes.AccessibilityAttributes.AnnouncementPriorityAttribute](foundation/attributescopes/accessibilityattributes/announcementpriorityattribute.md)
- [AttributeScopes.AccessibilityAttributes.HeadingLevelAttribute](foundation/attributescopes/accessibilityattributes/headinglevelattribute.md)
- [AttributeScopes.AccessibilityAttributes.TextualContextAttribute](foundation/attributescopes/accessibilityattributes/textualcontextattribute.md)
- [AttributeScopes.AppKitAttributes.AdaptiveImageGlyphAttribute](foundation/attributescopes/appkitattributes/adaptiveimageglyphattribute.md)
- [AttributeScopes.AppKitAttributes.StrikethroughStyleAttribute](foundation/attributescopes/appkitattributes/strikethroughstyleattribute.md)
- [AttributeScopes.AppKitAttributes.UnderlineStyleAttribute](foundation/attributescopes/appkitattributes/underlinestyleattribute.md)
- [AttributeScopes.FoundationAttributes.InflectionAlternativeAttribute](foundation/attributescopes/foundationattributes/inflectionalternativeattribute.md)
- [AttributeScopes.FoundationAttributes.InlinePresentationIntentAttribute](foundation/attributescopes/foundationattributes/inlinepresentationintentattribute.md)
- [AttributeScopes.FoundationAttributes.LinkAttribute](foundation/attributescopes/foundationattributes/linkattribute.md)
- [AttributeScopes.FoundationAttributes.ListItemDelimiterAttribute](foundation/attributescopes/foundationattributes/listitemdelimiterattribute.md)
- [AttributeScopes.FoundationAttributes.PersonNameComponentAttribute](foundation/attributescopes/foundationattributes/personnamecomponentattribute.md)
- [AttributeScopes.UIKitAttributes.AdaptiveImageGlyphAttribute](foundation/attributescopes/uikitattributes/adaptiveimageglyphattribute.md)
- [AttributeScopes.UIKitAttributes.StrikethroughStyleAttribute](foundation/attributescopes/uikitattributes/strikethroughstyleattribute.md)
- [AttributeScopes.UIKitAttributes.UnderlineStyleAttribute](foundation/attributescopes/uikitattributes/underlinestyleattribute.md)
