Skip to content

Instantly share code, notes, and snippets.

@kaishin
Created November 6, 2016 17:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaishin/816b7af3f55842a54349b0f1aa74dfe4 to your computer and use it in GitHub Desktop.
Save kaishin/816b7af3f55842a54349b0f1aa74dfe4 to your computer and use it in GitHub Desktop.
ATS Sample
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>redalemeden.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTKemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
guard let url = URL(string: "http://redalemeden.com") else { return }
URLSession.shared.dataTask(with: url) { data, response, error in
guard let data = data, let html = String(data: data, encoding: .utf8) else { return }
print(html)
}.resume()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment