Skip to content

Commit

Permalink
Merge pull request #14 from rbngzlv/feature/support-middle-name
Browse files Browse the repository at this point in the history
Added middle name field
  • Loading branch information
belkevich committed Jul 29, 2014
2 parents 5bd95c5 + ea798ee commit 4eada0b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions Classes/APContact.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

@property (nonatomic, readonly) APContactField fieldMask;
@property (nonatomic, readonly) NSString *firstName;
@property (nonatomic, readonly) NSString *middleName;
@property (nonatomic, readonly) NSString *lastName;
@property (nonatomic, readonly) NSString *compositeName;
@property (nonatomic, readonly) NSString *company;
Expand Down
4 changes: 4 additions & 0 deletions Classes/APContact.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ - (id)initWithRecordRef:(ABRecordRef)recordRef fieldMask:(APContactField)fieldMa
{
_firstName = [self stringProperty:kABPersonFirstNameProperty fromRecord:recordRef];
}
if (fieldMask & APContactFieldMiddleName)
{
_middleName = [self stringProperty:kABPersonMiddleNameProperty fromRecord:recordRef];
}
if (fieldMask & APContactFieldLastName)
{
_lastName = [self stringProperty:kABPersonLastNameProperty fromRecord:recordRef];
Expand Down
1 change: 1 addition & 0 deletions Classes/APTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ typedef NS_OPTIONS(NSUInteger , APContactField)
APContactFieldRecordID = 1 << 10,
APContactFieldCreationDate = 1 << 11,
APContactFieldModificationDate = 1 << 12,
APContactFieldMiddleName = 1 << 13,
APContactFieldDefault = APContactFieldFirstName | APContactFieldLastName |
APContactFieldPhones,
APContactFieldAll = 0xFFFF
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ APAddressBook *addressBook = [[APAddressBook alloc] init];
###### Select contact fields bit-mask
Available fields:
* APContactFieldFirstName - *contact first name*
* APContactFieldMiddleName - *contact middle name*
* APContactFieldLastName - *contact last name*
* APContactFieldCompany - *contact company (organization)*
* APContactFieldPhones - *contact phones array*
Expand Down

0 comments on commit 4eada0b

Please sign in to comment.