Skip to content

Instantly share code, notes, and snippets.

@Ben-G
Created March 12, 2015 16:43
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 Ben-G/fb4b586f59d43179c841 to your computer and use it in GitHub Desktop.
Save Ben-G/fb4b586f59d43179c841 to your computer and use it in GitHub Desktop.
Workaround for: 'PFObject' does not have a member named 'subscript'
// Workaround for Parse 1.6.4 and Xcode 6.3, see: http://stackoverflow.com/questions/28953306/pfobject-does-not-have-a-member-named-subscript/29015269#29015269
extension PFObject {
subscript(index: String) -> AnyObject? {
get {
return self.valueForKey(index)
}
set(newValue) {
if let newValue: AnyObject = newValue {
self.setValue(newValue, forKey: index)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment