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
![Ruby cheatsheet version 0.1](https://github.com/adamdahan/lighthouse-web/blob/master/ruby-cheatsheet-v-0.1/image/ruby-cheatsheet-v-0.1.png) |
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
var image: UIImage? | |
var imageURL = "Some url" | |
if let url = NSURL(string: imageURL) { | |
let request: NSURLRequest = NSURLRequest(URL: url) | |
let mainQueue = NSOperationQueue.mainQueue() | |
NSURLConnection.sendAsynchronousRequest(request, queue: mainQueue, completionHandler: { (response, data, error) -> Void in | |
if error == nil { | |
let image = UIImage(data: data) | |
dispatch_async(dispatch_get_main_queue(), { | |
// Update image |
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
let className = NSStringFromClass(obj.dynamicType) |
NewerOlder