Skip to content

Instantly share code, notes, and snippets.

@simonwhitaker
Last active August 29, 2015 14:27
Show Gist options
  • Save simonwhitaker/611dab6e3eed016edac5 to your computer and use it in GitHub Desktop.
Save simonwhitaker/611dab6e3eed016edac5 to your computer and use it in GitHub Desktop.
// Error: Cannot invoke 'JSONObjectWithData' with an argument list of type '(NSData, options: Int)'
NSJSONSerialization.JSONObjectWithData(data!, options: 0)
// Error: Type 'NSJSONReadingOptions' does not conform to protocol 'NilLiteralConvertible'
NSJSONSerialization.JSONObjectWithData(data!, options: nil)
// This works, but having to pass in 'rawValue' just feels hacky
NSJSONSerialization.JSONObjectWithData(data!, options: NSJSONReadingOptions(rawValue: 0))
// I'd expect to be able to do something like:
NSJSONSerialization.JSONObjectWithData(data!, options: NSJSONReadingOptions.None)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment