Generic Class

CNLabeledValue

A thread-safe class that defines an immutable value object that combines a contact property value with a label, such as a contact phone number combined with a label of Home, Work, or iPhone.

Topics

Setting Identifiers

var identifier: String

A unique identifier for the labeled value object.

init(label: String?, value: ValueType)

Returns a new labeled value identifier initialized with the specified label and value.

Setting Labels and Values

func settingLabel(String?)

Returns a labeled value object with an existing value and identifier.

func settingLabel(String?, value: ValueType)

Returns a labeled value object with the specified label and value with the existing identifier.

func settingValue(ValueType)

Returns a new value for an existing label and identifier.

Labels and Values

var label: String?

The label for a contact property value.

var value: ValueType

A contact property value.

Localization

class func localizedString(forLabel: String)

Returns a localized string for the specified label.

Constants

Generic Labels

These constants are predefined labels that can be used in a CNLabeledValue object having any value.

Email Labels

This constant is a predefined label that can be used in a CNLabeledValue object having an email address string value.

URL Address Labels

This constant is a predefined label that can be used in a CNLabeledValue object having a URL address string value.

Date Labels

This constant is a predefined label that can be used in a CNLabeledValue object having an NSDateComponents value.

Relationships

Generic Constraints

  • ValueType : NSCopying
    
  • ValueType : NSSecureCoding
    

Inherits From