Skip to content

Latest commit

 

History

History
58 lines (44 loc) · 2.15 KB

README.md

File metadata and controls

58 lines (44 loc) · 2.15 KB

SwiftyContacts

Language: Swift 5 License Swift Package Manager

A Swift library for Contacts framework.

Requirements

  • iOS 15+ / Mac OS X 12+
  • Xcode 14.0+

Installation

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/nenosllc/SwiftyContacts.git", .upToNextMajor(from: "2.0.0"))
]

Getting Started

More documentation can be found by downloading the project and building the Xcode DocC documentation from Xcode.

async-await

Requests access to the user's contacts

let access = try await requestAccess()

Request the current authorization status

let status = authorizationStatus()
print(status == CNAuthorizationStatus.authorized)

Fetch all contacts from device

let contacts = try await fetchContacts()

License

SwiftyContacts is available under the MIT license. See the LICENSE file for more info.