associatedtype ObjectiveCValue
The Objective-C type that corresponds to this key’s value type.
Availability 有効性
Technology
protocol ObjectiveCConvertibleAttributedStringKey
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 Any
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.
associatedtype ObjectiveCValue
static func objectiveCValue (for: Self.Value) -> Self.ObjectiveCValue
static func value(for: Self.ObjectiveCValue) -> Self.Value