OCKContactInfo Class Reference

Inherits from NSObject
Conforms to NSCopying
NSSecureCoding
Declared in OCKContactInfo.h

The OCKContactInfo class is an object that represents a specific way to contact an OCKContact.

  type

The contact info type. This determines the default icon displayed, as well as the default label and action, if none are specified.

@property (nonatomic, readonly) OCKContactInfoType type

Discussion

See the OCKContactInfoType enum.

Declared In

OCKContactInfo.h

  displayString

The string that will be used as the primary identification for the contact info item.

@property (nonatomic, readonly) NSString *displayString

Declared In

OCKContactInfo.h

  actionURL

The action URL which will be called when the contact items is selected. If nil, then the type property will be used to determine a default action.

@property (nonatomic, readonly, nullable) NSURL *actionURL

Declared In

OCKContactInfo.h

  label

The label for the contact info, which is the textual representation of the type of contact info. If this is not set explicitly it will default to a value based on the type.

@property (nonatomic, readonly) NSString *label

Declared In

OCKContactInfo.h

  icon

The label for the contact info, which is the visual representation of the type of contact info. If this is not set explicitly it will default to a value based on the type.

@property (nonatomic, readonly, nullable) UIImage *icon

Declared In

OCKContactInfo.h

– initWithType:displayString:actionURL:

Creates a new contact information item. The label and icon will be set to the default for the given contact type.

- (instancetype)initWithType:(OCKContactInfoType)type displayString:(NSString *)displayString actionURL:(nullable NSURL *)actionURL

Parameters

type

The type of contact info, which will define the display icon and the default action if no actionURL is specified.

displayString

The string that will be displayed to the user to represent the contact item.

actionURL

The action to take to initiate the connection. For example “sms:1-314-555-1234”, “tel:1-314-555-1234”, “facetime://user@example.com”

Return Value

An instance of the contact info.

Declared In

OCKContactInfo.h

– initWithType:displayString:actionURL:label:

Creates a new contact information item. The icon will be set to the default for the given contact type.

- (instancetype)initWithType:(OCKContactInfoType)type displayString:(NSString *)displayString actionURL:(nullable NSURL *)actionURL label:(NSString *)label

Parameters

type

The type of contact info, which will define the display icon and the default action if no actionURL is specified.

displayString

The string that will be displayed to the user to represent the contact item.

actionURL

The action to take to initiate the connection. For example “sms:1-314-555-1234”, “tel:1-314-555-1234”, “facetime://user@example.com”

label

The label of the contact info.

Return Value

An instance of the contact info.

Declared In

OCKContactInfo.h

– initWithType:displayString:actionURL:label:icon:

Creates a new contact information item.

- (instancetype)initWithType:(OCKContactInfoType)type displayString:(NSString *)displayString actionURL:(nullable NSURL *)actionURL label:(NSString *)label icon:(nullable UIImage *)icon

Parameters

type

The type of contact info, which will define the display icon and the default action if no actionURL is specified.

displayString

The string that will be displayed to the user to represent the contact item.

actionURL

The action to take to initiate the connection. For example “sms:1-314-555-1234”, “tel:1-314-555-1234”, “facetime://user@example.com”

label

The label of the contact info.

icon

The icon which represents the contact type. The contact tint color will be applied to this icon, which will be converted if needed to UIImageRenderingModeAlwaysTemplate.

Return Value

An instance of the contact info.

Declared In

OCKContactInfo.h

+ sms:

Creates a new contact info with an sms: action URL.

+ (OCKContactInfo *)sms:(NSString *)smsNumber

Parameters

smsNumber

The mobile phone number.

Declared In

OCKContactInfo.h

+ phone:

Creates a new contact info with an tel: action URL.

+ (OCKContactInfo *)phone:(NSString *)phoneNumber

Parameters

phoneNumber

The phone number.

Declared In

OCKContactInfo.h

+ email:

Creates a new contact info with a mailto: action URL.

+ (OCKContactInfo *)email:(NSString *)emailAddress

Parameters

emailAddress

The email address.

Declared In

OCKContactInfo.h

+ facetimeVideo:displayString:

Creates a new contact info with a facetime: action URL.

+ (OCKContactInfo *)facetimeVideo:(NSString *)emailAddressOrRawPhoneNumber displayString:(nullable NSString *)displayString

Parameters

emailAddressOrRawPhoneNumber

The email address or unformatted phone number.

displayString

The display string to represent the contact info. If nil then defaults to the emailAddressOrRawPhoneNumber.

Declared In

OCKContactInfo.h

+ facetimeAudio:displayString:

Creates a new contact info with a facetime-audio: action URL.

+ (OCKContactInfo *)facetimeAudio:(NSString *)emailAddressOrRawPhoneNumber displayString:(nullable NSString *)displayString

Parameters

emailAddressOrRawPhoneNumber

The email address or unformatted phone number.

displayString

The display string to represent the contact info. If nil then defaults to the emailAddressOrRawPhoneNumber.

Declared In

OCKContactInfo.h