vCardSerialization 0.0.1

vCardSerialization 0.0.1

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Mattt.



vCardSerialization encodes and decodes between vCard and AddressBook records, following the API conventions of Foundation's NSJSONSerialization class.

Usage

Decoding

@import AddressBookUI;

#import "vCardSerialization.h"

NSURL *URL = [[NSBundle mainBundle] URLForResource:@"contact" withExtension:@"vcf"];
NSData *data = [NSData dataWithContentsOfURL:URL];

ABPersonViewController *viewController = [[ABPersonViewController alloc] init];
viewController.displayedPerson = (__bridge ABRecordRef)[[vCardSerialization addressBookRecordsWithVCardData:data error:nil] firstObject];
ABPeoplePickerNavigationController *navigationController = [[ABPeoplePickerNavigationController alloc] initWithRootViewController:viewController];
[self.navigationController presentViewController:navigationController animated:YES completion:nil];

Encoding

NSArray *records = ...;
NSDate *data = [vCardSerialization vCardDataWithAddressBookRecords:records error:nil];

Contact

Mattt Thompson

License

vCardSerialization is available under the MIT license. See the LICENSE file for more info.