KBContactsSelection
KBContactsSelection copied to clipboard
Swift support?
I'm having problems using this with Swift getting the error "Could not build Objective-C module"
I've just checked that and you're absolutely right. I haven't found a real solution for that but a small walkaround may be like this:
- Make sure you enabled
use_frameworks!
in Podfile. - Open
Pods → KBContactsSelection → APContact+FullName.h
file and change#import "APContact.h"
to@import APAddressBook;
(when Xcode asks selectUnlock
file), - Open
Pods → KBContactsSelection → KBContactsTableViewDataSource.h
file and change#import "APAddressBook.h"
to@import APAddressBook;
After these changes I was able to use library in Swift with no further problems, e.g.:
import UIKit
import KBContactsSelection
class ViewController: UIViewController {
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
let vc = KBContactsSelectionViewController { (configuration) in }
presentViewController(vc, animated: true, completion: nil)
}
}