github.com/hyperoslo/NSEntityDescription-SYNCPrimaryKey

Support for primary keys in Core Data


License
Other

Documentation

NSEntityDescription-SYNCPrimaryKey

CI Status Version License Platform

Usage

By default NSEntityDescription-SYNCPrimaryKey gives id for remote primary key and id for the local primary key.

You can mark any attribute as primary key by adding hyper.isPrimaryKey and the value YES or true. You can also map it to any remote JSON attribute by adding hyper.remoteKey and the value the primary key in your JSON or remote entity such as contract_id.

NSEntityDescription-SYNCPrimaryKey will first look for a custom local primary key, then it will look for id and finally for remoteID, if after this no primary key is found, it will crash and burn.

Custom primary key

Interface

- (NSAttributeDescription *)sync_primaryKeyAttribute;

- (NSString *)sync_localPrimaryKey;

- (NSString *)sync_remotePrimaryKey;

Installation

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

pod 'NSEntityDescription-SYNCPrimaryKey'

Author

SyncDB, syncdb.contact@gmail.com

License

NSEntityDescription-SYNCPrimaryKey is available under the MIT license. See the LICENSE file for more info.