I've searched on the forums here and on the internet and have found quite a few posts regarding this behavior, but have yet to find a solid solution. I'm utilizing the following code in a Playground.
import UIKit
var strUrl = "https://www.apple.com/ipad/home/images/social/og.jpg?201505061144"
var url = NSURL(string: strUrl)
if let data = NSData(contentsOfURL: url!)
{
var img = UIImage(data: data)
}
else
{
print("No data")
}
if let data = NSData(contentsOfURL: url!, options: nil, error: nil)
{
var img = UIImage(data: data)
}
else
{
print("No data")
}
I get both "no data" statements in the results pane. I'm ruling out the security transport issues because it's a call to an Apple https location. The direct URL works just fine.
I'm using xCode 6.4. Any suggestions?