All Projects → nofelmahmood → CKSRecordContext

nofelmahmood / CKSRecordContext

Licence: MIT License
Interaction with CloudKit Records done right !

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to CKSRecordContext

Arek
AREK is a clean and easy way to request any kind of iOS permission (with some nifty features 🤖)
Stars: ✭ 947 (+4409.52%)
Mutual labels:  cloudkit
Mistkit
Swift Package for Server-Side and Command-Line Access to CloudKit Web Services
Stars: ✭ 129 (+514.29%)
Mutual labels:  cloudkit
Cloudkit Demo.swift
Stars: ✭ 244 (+1061.9%)
Mutual labels:  cloudkit
Ricloud
Python client for Reincubate's ricloud API. Yes, it works with iOS 14 & iPhone 12 backups!
Stars: ✭ 71 (+238.1%)
Mutual labels:  cloudkit
Icecream
Sync Realm Database with CloudKit
Stars: ✭ 1,646 (+7738.1%)
Mutual labels:  cloudkit
Cloudcore
Framework that enables syncing between iCloud (CloudKit) and Core Data
Stars: ✭ 146 (+595.24%)
Mutual labels:  cloudkit
Evcloudkitdao
Simplified access to Apple's CloudKit
Stars: ✭ 618 (+2842.86%)
Mutual labels:  cloudkit
requests-cloudkit
Apple CloudKit Python library.
Stars: ✭ 60 (+185.71%)
Mutual labels:  cloudkit
Cloudkitgdpr
Framework for allowing users to manage data stored in iCloud
Stars: ✭ 126 (+500%)
Mutual labels:  cloudkit
Crdt Playground
Stars: ✭ 215 (+923.81%)
Mutual labels:  cloudkit
Jotify
Sticky notes reimagined - written in Swift
Stars: ✭ 79 (+276.19%)
Mutual labels:  cloudkit
Todolist
A simple ToDoList written in Swift
Stars: ✭ 100 (+376.19%)
Mutual labels:  cloudkit
Notetaker
A simple note taking app for macOS and iOS which uses Realm and CloudKit for syncing
Stars: ✭ 156 (+642.86%)
Mutual labels:  cloudkit
Cirrus
☁️ Simple CloudKit sync for Codable Swift models
Stars: ✭ 65 (+209.52%)
Mutual labels:  cloudkit
ios-conference
iOS.Conf by Taxibeat app ⌚️📱
Stars: ✭ 14 (-33.33%)
Mutual labels:  cloudkit
Seam
Seamless CloudKit Sync with CoreData
Stars: ✭ 659 (+3038.1%)
Mutual labels:  cloudkit
Cloudkit Demo.objective C
Stars: ✭ 133 (+533.33%)
Mutual labels:  cloudkit
CloudKitFeatureFlags
A library that lets you setup feature flagging for your iOS app using CloudKit
Stars: ✭ 91 (+333.33%)
Mutual labels:  cloudkit
TMLPersistentContainer
Shortest-path multi-step Core Data migrations in Swift
Stars: ✭ 15 (-28.57%)
Mutual labels:  cloudkit
Seam3
Cloudkit based persistent store for Core Data
Stars: ✭ 207 (+885.71%)
Mutual labels:  cloudkit

CKSRecordContext

A dead simple way of Fetching, Inserting, Modifying and Deleting records from the CloudKit Databases.

How To Use

A CKRecordContext object holds all the new records, any changes and deletions to them until you call save() on an instance of it. It only then conveys the changes to the CloudKit Database.

var cksRecordContext:CKSRecordContext = CKRecordContext(database: CKContainer.defaultContainer().privateCloudDatabase, recordZone: nil)

Creating a new CKRecord

var ckRecord = cksRecordContext.insertNewCKRecord("NewRecordType")

Modifying a CKRecord

Any CKRecords you create using methods of CKRecordContext are monitored by it.

Deleting a CKRecord

var ckRecord = cksRecordContext.insertNewCKRecord("NewRecordType")
ckRecordContext.deleteRecord(record: ckRecord)

OR

var ckRecord = cksRecordContext.insertNewCKRecord("NewRecordType")
ckRecordContext.deleteRecord(recordID: ckRecord.recordID)

Fetching Records

func fetchCKRecord(recordID:CKRecordID,completion:(record:CKRecord?,error:NSError!) ->())
func fetchCKRecords(recordType:String,predicate:NSPredicate,completion:(results:Array<AnyObject>?,error:NSError!) ->())
func fetchCKRecords(recordType:String,predicate:NSPredicate,sortDescriptors:[NSSortDescriptor],completion:(results:Array<AnyObject>?,error:NSError!) ->())

Saving the Insertions, Modifications and Deletions to server.

Its a one liner !

cksRecordContext.save { (error) -> (Void) in
  if error != nil
    {
        print("Saved Successfully")
    }
}

Getting Started

Check out the sample iOS demo app.

Installation

CocoaPods is the recommended way of adding CKSRecordContext to your project.

You want to to add pod 'CKSRecordContext', '~> 0.5' similar to the following to your Podfile:

target 'MyApp' do
  pod 'CKSRecordContext', '~> 0.5'
end

Then run a [sudo] pod install inside your terminal, or from CocoaPods.app.

Credits

CKSRecordContext was created by Nofel Mahmood

Contact

Follow Nofel Mahmood on Twitter and GitHub or email him at [email protected]

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].