title: Slack Login does't work. Swift 3.0
body: <p>I develop iOS app with Slack integration using Swift 3.0. How I pass login process:</p>
  
  <pre><code>func loginToSlackWithSafariBrowser() {
      let scope = "channels%3Awrite+users%3Aread"
      let clientId = "...myClientId"
      let redirect_uri = "myAppDeepLink://"
      let authURL = NSURL(string: "https://slack.com/oauth/authorize?client_id=\(clientId)&amp;scope=\(scope)&amp;redirect_uri=\(redirect_uri)")
  
      guard let url  = authURL else { return }
      UIApplication.shared.openURL(url as URL)
  }
  </code></pre>
  
  <p>Then Safari app opens, I enter credential, tap "Authorize" and have alert like "Open in your app?"
  I tap yes and redirecting to my app, where I send next request with gained from Slack code:</p>
  
  <pre><code>        //AppDelegate.swift
  extension UIApplicationDelegate {
  func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: AnyObject) -&gt; Bool {
      self.exchangeCodeInURL(codeURL: url as NSURL)
      return true
  }
  
  func exchangeCodeInURL(codeURL : NSURL) {
      let clientId = "...myClientId"
      let clientSecret = "...myclientSecret"
      if let code = codeURL.query {
          let request = NSMutableURLRequest(url: NSURL(string: "https://slack.com/api/oauth.access?client_id=\(clientId)&amp;client_secret=\(clientSecret)&amp;code=\(code)") as! URL)
          request.httpMethod = "GET"
          request.setValue("application/json", forHTTPHeaderField: "Accept")
          URLSession.shared.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -&gt; Void in
              print(response)
              guard let unwrappedData = data else {return}
              do {
                  if let rootObject = try JSONSerialization.jsonObject(with: unwrappedData, options: []) as? NSDictionary {
                      //Save and handle the token
                      print(rootObject)
                  }
              }
              catch {
                  print(error)
              }
          }).resume()
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Code worked in Xcode 8 beta, but when I updated to Xcode 8 functions in extension are not called after redirect from Slack website.</p>
  
  <p>What is wrong?
  Is there a better way to pass Slack login process?</p>