Swiftpack.co - JosephDuffy/GatheredKit as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by JosephDuffy.
JosephDuffy/GatheredKit v0.2.0
Swift Package that provides a consistent API for various data sources offered by macOS, iOS, watchOS, and tvOS.
⭐️ 19
🕓 1 week ago
iOS macOS watchOS tvOS macCatalyst
.package(url: "https://github.com/JosephDuffy/GatheredKit.git", from: "v0.2.0")

GatheredKit

Tests Status codecov Documentation Compatible with macOS, iOS, watchOS, and tvOS SwiftPM Compatible MIT License

:warning: GatheredKit it currently in a pre-release beta. The API is unstable, although the only large planned breaking fix is to introduce structured concurrency for thread safety.

GatheredKit a protocol-oriented API for various data sources offered by macOS, iOS, watchOS, and tvOS.

The code originated from Gathered, hence the name and logo. Prior to version 2.0 Gathered used a closed-source version of GatheredKit. Version 2.0 is currently in beta and can accessed via TestFlight.

Provided Libraries

GatheredKit provides multiple libraries that each provide one or more data sources. This is done to allow the a subset of the data sources to be included, which aids with documentation, discovery, and ensures that consumers do not accidentally include APIs that require extra permissions, such as accessing the IDFA.

Each of these libraries roughly correlates to one of Apple's frameworks.

GatheredKit

The GatheredKit library is the core library that provides the types used by data sources, but it does not provide any of the data sources itself.

GatheredKitCamera

GatheredKitCamera provides access to cameras, both built-in and external. The CameraProvider can be used to query for connected cameras. It wraps the AVFoundation framework.

GatheredKitDevice

GatheredKitDevice provides various sources relating to the current device.

On iOS this wraps the UIKit framework, specifically UIDevice.

GatheredKitLocation

GatheredKitLocation provides the Location data source, which is used to access location-based information provided by the GPS and associated sensors. It relies on the Core Location framework.

GatheredKitMotion

GatheredKitMotion provides data sources that utilise the CoreMotion framework, such as an Accelerometer, Gyroscope, and Magnetometer.

GatheredKitProcessInfo

GatheredKitProcessInfo provides information relating to the computer the process is running on.

GatheredKitScreen

GatheredKitScreen provides access to the screens associated with the device.

Future Libraries

Below are the sources that are available in the Gathered app but have not yet been added to this open source project.

  • ☐ Compass
  • ☐ Microphone
  • ☐ Cell Radio
  • ☐ Device Attitude
  • ☐ Proximity
  • ☐ Advertising
  • ☐ Audio Output
  • ☐ Device Orientation
  • ☐ Bluetooth
  • ☐ Storage
  • ☐ Memory
  • ☐ Device Metadata
  • ☐ Operating System
  • ☐ CPU

Installation

SwiftPM

To install via SwiftPM add the package to the dependencies section and as the dependency of a target:

let package = Package(
    ...
    dependencies: [
        .package(url: "https://github.com/JosephDuffy/GatheredKit.git", from: "0.1.0"),
    ],
    targets: [
        .target(name: "MyApp", dependencies: ["GatheredKit"]),
    ],
    ...
)

Documentation

Documentation for GatheredKit is provided in the source code. Browsable documentation is available at https://josephduffy.github.io/GatheredKit/.

License

The project is released under the MIT license. View the LICENSE file for the full license.

GitHub

link
Stars: 20
Last commit: 4 hours ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

v0.2.0
1 week ago
  • Much improved API - Split in to multiple targets in a single package

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics