If you have noticed the contacts app on your iPhone/iPad, it displays the contacts based on your preference of  sort order and display order in Settings.



Contacts app on iPhone displays your contacts based on this order


Fortunately, there is a quick and easy snippet to get this information and use it on your app. The AddressBook framework provides a method called ABPersonGetSortOrdering() to read this info.

I use this code snippet to format the names respecting the user’s preference of sort order.

if(ABPersonGetSortOrdering() == kABPersonCompositeNameFormatFirstNameFirst)
	return [NSString stringWithFormat:@"%@ %@", self.firstName, self.lastName];
	return [NSString stringWithFormat:@"%@, %@", self.lastName, self.firstName];

You too can, on your next twitter client, use this to display the following/followers list.


Follow me on Twitter