Skip to content

Instantly share code, notes, and snippets.

@toast38coza
Created October 20, 2014 06:41
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 toast38coza/e663bfbdd1c96c7c7969 to your computer and use it in GitHub Desktop.
Save toast38coza/e663bfbdd1c96c7c7969 to your computer and use it in GitHub Desktop.
Save a class to parse with swift
## you need to create a bridging header: ParseExample-Bridging-Header.h
## #import <Parse/Parse.h>
Parse.setApplicationId("...", clientKey: "...")
var person = PFObject(className:"Person")
person.setObject("Joe", forKey: "firstname")
person.saveInBackgroundWithBlock{
(success: Bool!, error: NSError!) -> Void in
if success == true {
println("Created: \(person.objectId)")
} else {
println(error)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment