Created
June 9, 2014 11:41
-
-
Save kirs/0a5647bbe795f39d6958 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@IBAction func demoSubmitted(sender : AnyObject) { | |
someLabel.text = "changed" | |
loader.hidden = !loader.hidden | |
struct Person { | |
static let name = "Main" | |
} | |
let url:NSURL = NSURL(string:"https://gist.githubusercontent.com/kirs/915071a2186d2133cd73/raw/145a3fddbf786d3521496bc8d08c5d76f582270a/gistfile1.txt") | |
let request:NSURLRequest = NSURLRequest(URL:url) | |
let queue:NSOperationQueue = NSOperationQueue() | |
NSURLConnection.sendAsynchronousRequest(request, queue: queue, completionHandler:{ (response: NSURLResponse!, data: NSData!, error: NSError!) -> Void in | |
// NSString.alloc() | |
var statusCode = response.valueForKey("statusCode") | |
let result: NSString = NSString(data: data, encoding: NSUTF8StringEncoding) | |
// let parsed_result: NSDictionary = self.parseJSON(data) | |
var json_error: NSError? | |
let jsonDict = NSJSONSerialization.JSONObjectWithData(data, options: nil, error: &json_error) as NSDictionary | |
// self.someLabel.text = "fff" | |
println(result) | |
println(jsonDict) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment