I would like to use Drew McCormack's Ensembles from github to relieve my current iOS/swift/coredata/iCloud induced headache. All of the Ensembles examples are in Objective-C. I have it as a Framework in my project, but being a weekend coder, I can't extrapolate how to use it from the ObjC example code.
Has anyone seen a How-To for Ensembles using swift?
Adding: I have it as a framework, but how do I set it up and have it start Leeching? The Obj-C way is to
//SetupEnsemble
cloudFileSystem=[[CDEICloudFileSystemalloc] initWithUbiquityContainerIdentifier:@"container"];
ensemble=[[CDEPersistentStoreEnsemblealloc]initWithEnsembleIdentifier:@"MainStore" persistentStoreURL:storeURL
managedObjectModelURL:modelURL
cloudFileSystem:cloudFileSystem]; ensemble.delegate=self;
and then Leech
if(!ensemble.isLeeched){
[ensemble leechPersistentStoreWithCompletion:^(NSError *error) {
if (error) NSLog(@"Could not leech to ensemble: %@", error); }];}
The following steps describe how you add ensembles with the iCloud + Dropbox filesystem to your project:
Add a 'Podfile' to your project with this contents:
Run 'pod install' from your terminal
Create a ObjC bridging header
Add Ensembles (and other frameworks to the bridging header):
Happy coding: