About GTContactsKit
GTContactsKit is a comprehensive iOS framework that provides a simple and intuitive way to manage contacts in your app. Whether you need to create, update, delete, or import contacts, GTContactsKit has got you covered.
This powerful framework offers an abstraction layer on top of the Contacts framework, allowing you to easily perform complex operations on the address book. With GTContactsKit, managing and organizing contacts becomes seamless.
Key Features
- Simple and intuitive API for contact management
- Create, update, and delete contacts effortlessly
- Import contacts from various sources with ease
- Retrieve and display contact information efficiently
- Swiftly manage contact groups for easier organization
- Perform advanced contact search operations
Getting Started
To get started with GTContactsKit, follow the steps below:
- Install GTContactsKit by adding it to your project’s dependencies.
- Import the GTContactsKit module in your code.
- Ensure that the necessary permissions are set in your app’s Info.plist file to access contacts.
- Create an instance of GTContactsManager to begin working with contacts.
Refer to the GTContactsKit documentation and code examples for more detailed instructions on integrating and using the framework in your app.
Usage Examples
Here are a few examples showcasing the simplicity and power of GTContactsKit:
Create a Contact
let contact = GTContact()
contact.givenName = "John"
contact.familyName = "Doe"
contact.emails = [
GTContactEmail(label: .home, address: "john.doe@example.com")
]
contact.phoneNumbers = [
GTContactPhoneNumber(label: .work, number: "1234567890")
]
GTContactsManager.shared.save(contact) { result in
switch result {
case .success(let savedContact):
print("Contact saved with identifier: \(savedContact.identifier)")
case .failure(let error):
print("Failed to save contact: \(error.localizedDescription)")
}
}
Retrieve a Contact
let contactID = "ABC123" // Identifier of the contact to retrieve
GTContactsManager.shared.fetchContact(with: contactID) { result in
switch result {
case .success(let contact):
print("Retrieved contact: \(contact.displayName)")
case .failure(let error):
print("Failed to retrieve contact: \(error.localizedDescription)")
}
}
Delete a Contact
let contactID = "ABC123" // Identifier of the contact to delete
GTContactsManager.shared.deleteContact(with: contactID) { result in
switch result {
case .success:
print("Contact deleted successfully.")
case .failure(let error):
print("Failed to delete contact: \(error.localizedDescription)")
}
}
Documentation
For detailed documentation on GTContactsKit, please visit the official documentation site. You’ll find API reference, guides, and more to help you make the most of this powerful framework.
Contribute
We welcome contributions to improve GTContactsKit. If you encounter any issues or have suggestions for enhancements, please open an issue or submit a pull request on our GitHub repository.
License
GTContactsKit is released under the MIT License. See the LICENSE file for more details.