SBSDKContactQRCode

@interface SBSDKContactQRCode : SBSDKMachineReadableCode

A specific subclass of SBSDKMachineReadableCode, that represents a QR code with personal contact information (vCard, MeCard). Upon creation it tries to geocode all contained postal adresses. Before accessing contact property, make sure processing equals 0.

  • The contact record generated from the QR codes vCard or MeCard string.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) CNContact *contact;

    Swift

    var contact: CNContact! { get set }
  • The display name of the contact. Usually is first name + last name.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic) NSString *displayName;

    Swift

    var displayName: String! { get }
  • The number of addresses currently being geocoded. If value drops to 0 it is safe to use the self.contact. KVO-able.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSUInteger processing;

    Swift

    var processing: UInt { get }
  • Internal helper function to parse adresses from a contact.

    Declaration

    Objective-C

    + (NSArray<CNLabeledValue<CNPostalAddress *> *> *)
          postalAddressesForContact:(CNContact *)contact
        additionalAddressDictionary:(NSDictionary *)dictionary
                              label:(NSString *)label;

    Swift

    class func postalAddresses(for contact: CNContact!, additionalAddressDictionary dictionary: [AnyHashable : Any]!, label: String!) -> [CNLabeledValue<CNPostalAddress>]!