This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
import Foundation | |
public typealias JSON = AnyObject | |
public func JSONWithData(data: NSData) -> JSON? { | |
do { | |
let j = try NSJSONSerialization.JSONObjectWithData(data, options: []) | |
return j | |
} catch _ { | |
return nil |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer