Skip to content

Instantly share code, notes, and snippets.

@marcweil
Last active August 26, 2016 07:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcweil/8756b2b894f4478c060f to your computer and use it in GitHub Desktop.
Save marcweil/8756b2b894f4478c060f to your computer and use it in GitHub Desktop.
#import <CloudMine/CloudMine.h>
var myObject = CMObject(objectId: "mycar")
CMStore *store = [CMStore defaultStore];
[store allObjectsWithOptions:nil
callback:^(CMObjectFetchResponse *response) {
NSLog(@"Objects: %@", response.objects);
}
];
CMStore.defaultStore().allObjectsWithOptions(nil, callback: {
response : CMObjectFetchResponse!) -> Void in
NSLog("Fetched: %@", response.objects);
})
[mycar save:^(CMObjectUploadResponse *response) {
NSLog(@"Status: %@", [response.uploadStatuses objectForKey:mycar.objectId]);
}];
myObject.save {
(response : CMObjectUploadResponse!) -> Void in
NSLog("Object was uploaded successfully! %@", response.uploadStatuses)
}
myObject.save {
response in NSLog("Object was uploaded successfully! %@", response.uploadStatuses)
}
@FHdeguzman
Copy link

Do you have sample code on loginWithCallback in swift? I've been trying the sample code in objective c and converted it in Swift, been having an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment