APAddressBook alternatives and similar libraries
Based on the "UI" category.
Alternatively, view APAddressBook alternatives based on common mentions on social networks and blogs.
-
Lottie
An iOS library to natively render After Effects vector animations -
DZNEmptyDataSet
A drop-in UITableView/UICollectionView superclass category for showing empty datasets whenever the view has no content to display -
SVProgressHUD
A clean and lightweight progress HUD for your iOS and tvOS app. -
IGListKit
A data-driven UICollectionView framework for building fast and flexible lists. -
iCarousel
A simple, highly customisable, data-driven 3D carousel for iOS and Mac OS -
AsyncDisplayKit
Smooth asynchronous user interfaces for iOS apps. -
IQKeyboardManager
Codeless drop-in universal library allows to prevent issues of keyboard sliding up and cover UITextField/UITextView. Neither need to write any code nor any setup required and much more. -
TTTAttributedLabel
A drop-in replacement for UILabel that supports attributes, data detectors, links, and more -
SkeletonView
☠️ An elegant way to show users that something is happening and also prepare them to which contents they are awaiting -
NVActivityIndicatorView
A collection of awesome loading animations -
FSCalendar
A fully customizable iOS calendar library, compatible with Objective-C and Swift -
animated-tab-bar
:octocat: RAMAnimatedTabBarController is a Swift UI module library for adding animation to iOS tabbar items and icons. iOS library made by @Ramotion -
Material
A UI/UX framework for creating beautiful applications. -
folding-cell
:octocat: 📃 FoldingCell is an expanding content cell with animation made by @Ramotion -
MGSwipeTableCell
An easy to use UITableViewCell subclass that allows to display swippable buttons with a variety of transitions. -
SWTableViewCell
An easy-to-use UITableViewCell subclass that implements a swippable content view which exposes utility buttons (similar to iOS 7 Mail Application) -
LTMorphingLabel
[EXPERIMENTAL] Graceful morphing effects for UILabel written in Swift. -
TPKeyboardAvoiding
A drop-in universal solution for moving text fields out of the way of the keyboard in iOS -
JTAppleCalendar
The Unofficial Apple iOS Swift Calendar View. Swift calendar Library. iOS calendar Control. 100% Customizable -
XLForm
XLForm is the most flexible and powerful iOS library to create dynamic table-view forms. Fully compatible with Swift & Obj-C. -
SwiftMessages
A very flexible message bar for iOS written in Swift. -
ViewAnimator
ViewAnimator brings your UI to life with just one line -
FSPagerView
FSPagerView is an elegant Screen Slide Library. It is extremely helpful for making Banner View、Product Show、Welcome/Guide Pages、Screen/ViewController Sliders. -
JVFloatLabeledTextField
UITextField subclass with floating labels - inspired by Matt D. Smith's design: http://dribbble.com/shots/1254439--GIF-Mobile-Form-Interaction?list=users -
SCLAlertView-Swift
Beautiful animated Alert View. Written in Swift -
SVPullToRefresh
Give pull-to-refresh & infinite scrolling to any UIScrollView with 1 line of code. -
PageMenu
A paging menu controller built from other view controllers placed inside a scroll view (like Spotify, Windows Phone, Instagram) -
SwipeCellKit
Swipeable UITableViewCell/UICollectionViewCell based on the stock Mail.app, implemented in Swift. -
Alerts & Pickers
Advanced usage of UIAlertController and pickers based on it: Telegram, Contacts, Location, PhotoLibrary, Country, Phone Code, Currency, Date... -
AMScrollingNavbar
Scrollable UINavigationBar that follows the scrolling of a UIScrollView -
Macaw
Powerful and easy-to-use vector graphics Swift library with SVG support -
Koloda
KolodaView is a class designed to simplify the implementation of Tinder like cards on iOS. -
TextFieldEffects
Custom UITextFields effects inspired by Codrops, built using Swift -
ViewDeck
An implementation of the sliding menu found in various iOS apps. -
SwiftEntryKit
SwiftEntryKit is a presentation library for iOS. It can be used to easily display overlays within your iOS apps. -
SWRevealViewController
A UIViewController subclass for presenting side view controllers inspired on the FaceBook and Wunderlist apps, done right ! -
Material Components
[In maintenance mode] Modular and customizable Material Design UI components for iOS -
TSMessages
💌 Easy to use and customizable messages/notifications for iOS à la Tweetbot -
SideMenu
Simple side/slide menu control for iOS, no code necessary! Lots of customization. Add it to your project in 5 minutes or less. -
CSStickyHeaderFlowLayout
UICollectionView replacement of UITableView. Do even more like Parallax Header, Sticky Section Header. Made for iOS 7.
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of APAddressBook or a related project?
README
APAddressBook is a wrapper on AddressBook.framework that gives easy access to native address book without pain in a head.
Features
- Load contacts from iOS address book asynchronously
- Decide what contact data fields you need to load (for example, only name and phone number)
- Filter contacts to get only necessary records (for example, you need only contacts with email)
- Sort contacts with array of any NSSortDescriptor
- Get photo of contact
Objective-c
Installation via Cocoapods
Add APAddressBook
pod to Podfile
pod 'APAddressBook'
Installation via Carthage
Add to your Cartfile
github 'Alterplay/APAddressBook'
Run carthage update
to fetch and build the framework. Add APAddressBook.framework
to your project's 'Linked Frameworks and Libraries'. Ensure that $(SRCROOT)/Carthage/Build/iOS/APAddressBook.framework
is part of the carthage copy-framework build phase.
Warning for iOS 10.0 and after
To protect user privacy, an iOS app linked on or after iOS 10.0, and which accesses the user’s contacts, must statically declare the intent to do so. Include the NSContactsUsageDescription
key in your app’s Info.plist
file and provide a purpose string for this key. If your app attempts to access the user’s contacts without a corresponding purpose string, your app exits.
From here.
Load contacts
APAddressBook *addressBook = [[APAddressBook alloc] init];
// don't forget to show some activity
[addressBook loadContacts:^(NSArray <APContact *> *contacts, NSError *error)
{
// hide activity
if (!error)
{
// do something with contacts array
}
else
{
// show error
}
}];
Callback block will be run on main queue! If you need to run callback block on custom queue use
loadContactsOnQueue:completion:
method
Select contact fields bit-mask
Available fields:
- APContactFieldName - first name, last name, middle name, composite name
- APContactFieldJob - company (organization), job title
- APContactFieldThumbnail - thumbnail image
- APContactFieldPhonesOnly - array of phone numbers disregarding phone labels
- APContactFieldPhonesWithLabels - array phones with original and localized labels
- APContactFieldEmailsOnly - array of email addresses disregarding email labels
- APContactFieldEmailsWithLabels - array of email addresses with original and localized labels
- APContactFieldAddressesWithLabels - array of contact addresses with original and localized labels
- APContactFieldAddressesOnly - array of contact addresses disregarding addresses labels
- APContactFieldSocialProfiles - array of contact profiles in social networks
- APContactFieldBirthday - date of birthday
- APContactFieldWebsites - array of strings with website URLs
- APContactFieldNote - string with notes
- APContactFieldRelatedPersons - array of related persons
- APContactFieldLinkedRecordIDs - array of contact linked records IDs
- APContactFieldSource - contact source ID and source name
- APContactFieldDates - contact dates with localized and original labels
- APContactFieldRecordDate - contact record creation date and modification date
- APContactFieldDefault - contact name and phones without labels
- APContactFieldAll - all contact fields described above
Contact
recordID
property is always available
Example of field mask with name and thumbnail:
APAddressBook *addressBook = [[APAddressBook alloc] init];
addressBook.fieldsMask = APContactFieldFirstName | APContactFieldThumbnail;
Filter contacts
The most common use of this option is to filter contacts without phone number. Example:
addressBook.filterBlock = ^BOOL(APContact *contact)
{
return contact.phones.count > 0;
};
Sort contacts
APAddressBook returns unsorted contacts. So, most of users would like to sort contacts by first name and last name.
addressBook.sortDescriptors = @[
[NSSortDescriptor sortDescriptorWithKey:@"name.firstName" ascending:YES],
[NSSortDescriptor sortDescriptorWithKey:@"name.lastName" ascending:YES]
];
Load contact by address book record ID
[addressBook loadContactByRecordID:recordID completion:^(APContact *contact)
{
self.contact = contact;
}];
APContact
instance will contain fields that set inaddressBook.fieldsMask
Callback block will be run on main queue! If you need to run callback block on custom queue use
loadContactByRecordID:onQueue:completion:
method
Load contact photo by address book record ID
[addressBook loadPhotoByRecordID:recordID completion:^(UIImage *image)
{
self.imageView.image = image;
}];
Callback block will be run on main queue! If you need to run callback block on custom queue use
loadPhotoByRecordID:onQueue:completion:
method
Observe address book external changes
// start observing
[addressBook startObserveChangesWithCallback:^
{
// reload contacts
}];
// stop observing
[addressBook stopObserveChanges];
Request address book access
[addressBook requestAccess:^(BOOL granted, NSError *error)
{
// check `granted`
}];
Check address book access
switch([APAddressBook access])
{
case APAddressBookAccessUnknown:
// Application didn't request address book access yet
break;
case APAddressBookAccessGranted:
// Access granted
break;
case APAddressBookAccessDenied:
// Access denied or restricted by privacy settings
break;
}
Swift
Installation via Cocoapods
pod 'APAddressBook/Swift'
Import APAddressBook-Bridging.h
to application's objective-c bridging file.
#import <APAddressBook/APAddressBook-Bridging.h>
Installation via Carthage
Add to your Cartfile
github 'Alterplay/APAddressBook'
Run carthage update
to fetch and build the framework. Add APAddressBook.framework
to your project's 'Linked Frameworks and Libraries'. Ensure that $(SRCROOT)/Carthage/Build/iOS/APAddressBook.framework
is part of the carthage copy-framework build phase.
Example
See example application in Example/Swift
directory.
self.addressBook.loadContacts(
{ (contacts: [APContact]?, error: Error?) in
if let uwrappedContacts = contacts {
// do something with contacts
}
else if let unwrappedError = error {
// show error
}
})
APContact serialization
Use APContact-EasyMapping by Jean Lebrument
0.1.x to 0.2.x Migration guide
History
Contributor guide
Contacts
If you have improvements or concerns, feel free to post an issue and write details.
Check out all Alterplay's GitHub projects. Email us with other ideas and projects.