2

I've just updated to Xcode 7 and Swift 2.0, and of course it has caused some issues in my app. I have solved a lot of them, but I am struggling with this one.

In my table view, I am loading images from Parse.com, but for some reason, the images are not being displayed in the AsyncImageView. This code worked perfectly prior to updating so I'm not sure what the issue is:

 AsyncImageLoader.sharedLoader().cancelLoadingURL(cell.rideImageView.imageURL) cell.rideImageView.image = UIImage(named: "Unloaded") cell.rideImageView.imageURL = NSURL(string: ride.rideImageSmall!) 

I've checked to make sure the image URL is being loaded correctly from Parse, and it is. This is the library I'm using: https://github.com/nicklockwood/AsyncImageView

Anyone have any ideas?

2
  • What does the url look like? Is it an external URL and is it http:// or https:// ? Commented Sep 26, 2015 at 17:57
  • Here is an example - http://files.parsetfss.com/0f7ec53c-ea56-4a8a-9927-9ff94e1c40bd/tfss-4471a63f-f237-4542-8cfb-e343b6fa0242-Space%20Mountain_550x412.png Commented Sep 26, 2015 at 18:09

1 Answer 1

6
+100

You likely encounter blocked network requests because of Apple's new "Apple Transport Security" which is active since iOS9 (= Xcode7). If you want to load data from http:// URLs you need to tell the app, that ATS shall not apply for your app or for certain domains.

Apple's technote is here: https://developer.apple.com/library/prerelease/ios/technotes/App-Transport-Security-Technote/

As a start you may add a dictionary NSAppTransportSecurity with the entry NSAllowArbitraryLoads = ON to your Info.plist and see how far you get:

enter image description here

If some names of the ATS settings don't work for you, read the following blog article, which describes different names - these worked for me in the past: http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/

Sign up to request clarification or add additional context in comments.

2 Comments

One more quick question, I'm also parsing data from a webpage. I tried using the same technique, but it's not working for this URL - http://dlwait.zingled.com/mk. I am using NSExceptionAllowsInsecureHTTPLoads and NSIncludesSubdomains, both set to YES. NSExceptionDomains is http://dlwait.zingled.com.
@user3746428 You only need to set the domain without the http:, so just use dlwait.zingled.com. Try to use this NSTemporaryThirdPartyExceptionAllowsInsecureHTTPLoads (taken from the blog article) instead of the one from the technote.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.