Giter Site home page Giter Site logo

cloudykit's Introduction

CloudyKit

Test workflow Twitter

CloudyKit is a drop in replacement for Apple's CloudKit on Linux. It uses CloudKit Web Services behind the scenes and has the same API that is used on iOS and macOS.

Installation

Swift Package Manager

CloudyKit is available through Swift Package Manager. To install it, add the dependency to your Package.swift file:

dependencies: [
    .package(url: "https://github.com/camdenfullmer/CloudyKit.git", from: "0.1.0"),
],
targets: [
    .target(name: "YourTarget", dependencies: ["CloudyKit"]),
]

Configuration

Before you get started using CloudyKit there a few things that need to be set up first.

Server-to-Server Key

First, you must create a Server-to-Server Key that CloudyKit can use to authenticate its requests.

CloudyKitConfig.serverKeyID = "YOUR SERVER KEY ID"
CloudyKitConfig.serverPrivateKey = try CKPrivateKey(path: "eckey.pem")

Environment

CloudyKit allows you to switch between your development and production environments by doing the following:

CloudyKitConfig.environment = .development // Use `.production` for production.

Supported Features

Below is the list of supported and upcoming features for CloudyKit.

  • Creating Records
  • Saving Records
  • Fetching Records
  • Querying Records
  • Deleting Records
  • Uploading Assets
  • All Types (missing Locations, Lists)
  • Private and Shared Databases
  • Operations
  • Errors
  • Fetching Record Changes

API Differences

NSSortDescriptor

NSSortDescriptor on Linux does not offer an initializer with a key String value. Instead, use the typealias SortDescriptor that offers the same API.

let sortDescriptor = SortDescriptor(key: "KEY", ascending: true) // instead of NSSortDescriptor(key: "KEY", ascending: true)

NSPredicate

NSPredicate on Linux does not support an initializer with a predicate format. Instead, use the typealias Predicate that offers the same API.

let predicate = Predicate(format: "ANY favoriteColors = 'red'") // instead of NSPredicate(format: "ANY favoriteColors = 'red'")

Questions

Please open up an issue or reach out to me on Twitter if you have any questions or need help using the library!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.