Latest 0.5.0
Homepage https://github.com/int123c/Cloudability
License MIT
Platforms ios 10.0
Dependencies RealmSwift, PromiseKit/CloudKit
Authors

CI Status
Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

Cloudability is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'Cloudability'

Usage

  1. Mark your objects with Cloudable.
  2. Create an instance of Cloud somewhere.
  3. Call cloud.switchOn(completionHandler:) to start it.
  4. Done

When you delete an Cloudable object, please use realm.delete(cloudableObject:) instead.

Optionally,

  • Exclude PendingRelationship and SyncedEntity from your realm configuration. Though they are stored in another realm file in documents/cloudability.realm.
  • Listen to push notifications.
    By default, Cloudability creates database subscriptions for private and shared database. You can call cloud.pull(completionHandler:) when you recieve a notification.
  • Conform your objects to HasAfterMergeAction and HasBeforeDeletionAction.

Behaviours

It supports several zoneTypes when you create a Cloud, but only .custom(String) is tested (I mean used in my app). It may lose some abilities if you are using the default CKContainer or the default CKZone.

When you switchOn a Cloud, it will perform sync immediately. If your device has not logged into iCloud, you will get an Error instead.

By default, Cloudability creates database subscriptions for private and shared database. If you want other subscriptions, you have to do it yourself.

Cloudability will listen to database changes, and do pushing automatically. But realm observations don’t care that much about deleted objects, so you should use realm.delete(cloudableObject:) instead when deleting an Cloudable object.

Relations between objects are converted to CKReference when talking to CloudKit. LinkingObjects and relations to non-Cloudable objects will be ignored.

It’s still under construction

Not even unit tested. Used in my iOS app Best Before.

Author

int123c, [email protected]

License

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

Latest podspec

{
    "name": "Cloudability",
    "version": "0.5.0",
    "summary": "Sync Realm with CloudKit",
    "description": "A library that make Realm sync with CloudKit.",
    "homepage": "https://github.com/int123c/Cloudability",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "int123c": "[email protected]"
    },
    "source": {
        "git": "https://github.com/int123c/Cloudability.git",
        "tag": "version/0.5.0"
    },
    "platforms": {
        "ios": "10.0"
    },
    "source_files": "Cloudability/Classes/**/*",
    "swift_version": "4.1",
    "dependencies": {
        "RealmSwift": [],
        "PromiseKit/CloudKit": [
            "~> 6.0"
        ]
    }
}

Pin It on Pinterest

Share This