Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Awesome Swift Playgrounds | 4,009 | 19 days ago | 1 | other | Swift | |||||
A List of Awesome Swift Playgrounds | ||||||||||
Hellosilicon | 2,859 | a month ago | 9 | mit | Assembly | |||||
An introduction to ARM64 assembly on Apple Silicon Macs | ||||||||||
Swift Summary | 1,668 | 2 years ago | 3 | mit | Swift | |||||
A summary of Apple's Swift language written on Playgrounds | ||||||||||
Learn Swift | 774 | 3 years ago | 14 | Swift | ||||||
Learn Apple's Swift programming language interactively through these playgrounds. | ||||||||||
Practical Python And Opencv | 75 | 6 years ago | TeX | |||||||
:green_apple:Latex: translate the book practical python and opencv to Chinese | ||||||||||
Learning Core Audio Swift Samplecode | 72 | 3 years ago | 1 | mit | Swift | |||||
Swift sample code for the book, Learning Core Audio. The original sample code was written in C/Objective-C but I tried to make it in Swift version. | ||||||||||
Best | 23 | 5 years ago | 1 | |||||||
Gifts for Programmers | ||||||||||
Asleye | 20 | 5 | 5 years ago | 4 | October 22, 2018 | 1 | mit | Swift | ||
ASLEye is an ASL(Apple System Log) monitor, automatic catch the log from NSLog by asl module | ||||||||||
Spritekitbook Swift | 16 | 7 years ago | 6 | apache-2.0 | Swift | |||||
Source code and resources for the book "Epic SpriteKit Tutorial with Swift" | ||||||||||
Middlemac | 11 | 2 years ago | 1 | mit | Ruby | |||||
Make multi-feature, multi-target macOS Help Books for macOS applications |
To run the example project, clone the repo, and run pod install
from the Example directory first.
import AddressBookManager
...
var abManager: AddressBookManager? = AddressBookManager()
switch (AddressBookManager.getAuthorizationStatus()) {
case .Authorized:
// Authorized To Use AddressBook
case .Denied:
// Denied Access To AddressBook
case .Restricted:
// Restricted Access To AddressBook
case .Unknown:
// Access To AddressBook Unknown, Most Likely AddressBook Authorization Has Not Been Requested Yet
}
// Option 1
abManager?.requestAuthorizationWithCompletion({ (granted: Bool, error: CFError?) -> Void in
if (error) {
// Handle Error
} else if (granted) {
var people = abManager?.allContacts
// Do Something With Contacts
}
})
// Option 2 - If you want to use a specific queue for retrieval
abManager?.retrieveAllContactsInQueue(dispatch_get_main_queue(),
completion: { (contacts: [AddressBookPerson]?, error: CFError?) -> Void in
if (error) {
// Handle Error
} else {
// Do Something With Contacts
}
})
// Sort Contacts In Ascending Order By First Name
abManager?.retrieveAllContactsInQueue(dispatch_get_main_queue(),
sort: { $0.firstName < $1.firstName },
completion: { (contacts: [AddressBookPerson]?, error: CFError?) -> Void in
if (error) {
// Handle Error
} else {
// Do Something With Contacts
}
})
// Retrieve Contacts That Have Atleast One Email
abManager?.retrieveAllContactsInQueue(dispatch_get_main_queue(),
filter: { count($0.emails!) > 0 },
completion: { (contacts: [AddressBookPerson]?, error: CFError?) -> Void in
if (error) {
// Handle Error
} else {
// Do Something With Contacts
}
})
// Retrieve Only Contacts That Have Atleast One Email And Sort Those Contacts In Ascending Order By First Name
abManager?.retrieveAllContactsInQueue(dispatch_get_main_queue(),
sort: { $0.firstName < $1.firstName },
filter: { count($0.emails!) > 0 },
completion: { (contacts: [AddressBookPerson]?, error: CFError?) -> Void in
if (error) {
// Handle Error
} else {
// Do Something With Contacts
}
})
abm.requestAuthorizationWithCompletion { (granted: Bool, error: CFError?) -> Void in
var person = AddressBookPerson()
person.firstName = "Bob"
person.lastName = "Smith"
var personalEmail = MultiValue(key: "personal", value: "[email protected]")
person.emails = [personalEmail]
var homePhoneNumber = MultiValue(key: "home", value: "5555555555")
var mobilePhoneNumber = MultiValue(key: "mobile", value: "1234567890")
person.phoneNumbers = [homePhoneNumber, mobilePhoneNumber]
person.profilePicture = UIImage(named: "bob.png")
var homeAddress = Dictionary<AddressProperty, AnyObject>()
homeAddress[AddressProperty.Street] = "123 Maple Street"
homeAddress[AddressProperty.City] = "Miami"
homeAddress[AddressProperty.State] = "FL"
homeAddress[AddressProperty.ZipCode] = "00000"
homeAddress[AddressProperty.Country] = "USA"
var homeAddressValue = MultiValue(key: "home", value: homeAddress)
person.addresses = [homeAddressValue]
var dateFormatter: NSDateFormatter = NSDateFormatter()
dateFormatter.dateFormat = "MM/dd/yyyy"
let birthday: NSDate? = dateFormatter.dateFromString("01/01/1970")
person.birthday = birthday
person.organization = "Some Huge Organization"
person.jobTitle = "Developer"
person.department = "Software"
person.note = "Some Note Here"
var personalURL = MultiValue(key: "personal", value: "https://somewebsite")
person.urls = [personalURL]
person.prefix = "Mr"
person.suffix = "Jr"
person.middleName = "Roger"
var anniversaryDate = MultiValue(key: "anniversary", value: dateFormatter.dateFromString("02/02/2000"))
person.dates = [anniversaryDate]
abm?.addRecord(person)
abm?.save()
}
AddressBookManager is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "AddressBookManager"
OR
You can simply clone this repository and drag the files into your project.
Aadesh Patel, [email protected]
AddressBookManager is available under the MIT license. See the LICENSE file for more info.