Skip to content

Commit

Permalink
Updates to Xcode 6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaskubanek committed Oct 8, 2014
1 parent 31804c7 commit 2021043
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Sources/LoremSwiftum.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ extension Lorem {
}

public class func URL() -> NSURL {
return NSURL(string: "http://" + domains.randomElement() + "/")
return NSURL(string: "http://" + domains.randomElement() + "/")!
}

public class func tweet() -> String {
Expand Down Expand Up @@ -157,13 +157,13 @@ extension Lorem {
private func toURL(width: Int, _ height: Int) -> NSURL {
switch self {
case .LoremPixel, .Default:
return NSURL(string: "http://lorempixel.com/\(width)/\(height)/")
return NSURL(string: "http://lorempixel.com/\(width)/\(height)/")!
case .Hhhhold:
return NSURL(string: "http://hhhhold.com/\(width)x\(height)/")
return NSURL(string: "http://hhhhold.com/\(width)x\(height)/")!
case .DummyImage:
return NSURL(string: "http://dummyimage.com/\(width)x\(height)/")
return NSURL(string: "http://dummyimage.com/\(width)x\(height)/")!
case .PlaceKitten:
return NSURL(string: "http://placekitten.com/\(width)/\(height)")
return NSURL(string: "http://placekitten.com/\(width)/\(height)")!
}
}
}
Expand All @@ -177,7 +177,7 @@ extension Lorem {
}

public class func image(#width: Int, height: Int, _ service: ImageService = .Default) -> UIImage {
return UIImage(data: NSData(contentsOfURL: imageURL(width: width, height: height, service)))
return UIImage(data: NSData(contentsOfURL: imageURL(width: width, height: height, service))!)!
}

public class func image(size: CGSize, _ service: ImageService = .Default) -> UIImage {
Expand All @@ -192,7 +192,7 @@ extension Lorem {
let request = NSURLRequest(URL: imageURL(width: width, height: height, service))
NSURLConnection.sendAsynchronousRequest(request, queue: NSOperationQueue.mainQueue()) {
(response: NSURLResponse!, data: NSData!, error: NSError!) -> Void in
completionHandler(UIImage(data: data))
completionHandler(UIImage(data: data)!)
}
}

Expand Down

0 comments on commit 2021043

Please sign in to comment.