ddi

DDiCloudSync

Sync your NSUserDefaults to iCloud automatically

Showing:

Popularity

Downloads/wk

0

GitHub Stars

49

Maintenance

Last Commit

8yrs ago

Contributors

5

Package

Dependencies

0

License

MIT

Categories

Readme

What is this?

A clean and simple class to sync NSUserDefaults to iCloud.

How to use?

  1. Drag the two classes from the DDiCloudSync folder into your projecy and #import the header file in your Application Delegate
  2. init the class: [DDiCloudSync sharedSync] and set a delegate to handle merging potentially conflicting data from local or from iCloud
  3. Call [DDiCloudSync start];

Example delegate

whenever something is about to be sync'd up, this method is called to provide a final dictionary to send

- (NSDictionary*)mergedDefaultsForUpdatingCloud:(NSDictionary*)dictInCloud withLocalDefaults:(NSDictionary*)dict {
    NSMutableDictionary *newdict = dict.mutableCopy;
    newdict[@"merged"] = @"to icloud";
    return newdict;
}

whenever something is about to be sync'd down, this method is called to provide a final dictionary to write to the defaults

   - (NSDictionary*)mergedDefaultsForUpdatingLocalDefaults:(NSDictionary*)dict withCloud:(NSDictionary*)dictInCloud {
    NSMutableDictionary *newdict = dict.mutableCopy;
    newdict[@"merged"] = @"from icloud";
    return newdict;
}

note: when you dont set a delegate, the class just overwrites the cloud / the local defaults

based on original MKiCloudSync code by @mugunthkumar

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100