A Swift library for Contacts framework.
- iOS 11.0+ / Mac OS X 10.13+ / watchOS 4.0+
- Xcode 13.0+
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
$ gem install cocoapods
To integrate SwiftyContacts into your Xcode project using CocoaPods, specify it in your Podfile
:
pod 'SwiftyContacts'
Then, run the following command:
$ pod install
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift
compiler. It is in early development, but SwiftyContacts does support its use on supported platforms.
Once you have your Swift package set up, adding SwiftyContacts as a dependency is as easy as adding it to the dependencies
value of your Package.swift
.
dependencies: [
.package(url: "https://github.com/Alamofire/SwiftyContacts.git", .upToNextMajor(from: "4.0.0"))
]
let access = try await requestAccess()
let contacts = try await fetchContacts()
requestAccess { result in
switch result {
case let .success(bool):
print(bool)
case let .failure(error):
print(error.localizedDescription)
}
}
fetchContacts { result in
switch result {
case let .success(contacts):
print(contacts)
case let .failure(error):
print(error.localizedDescription)
}
}
Satish Babariya, [email protected]
SwiftyContacts is available under the MIT license. See the LICENSE file for more info.