Skip to content

Instantly share code, notes, and snippets.

@AlexandreCools
Created May 17, 2020 14:15
Show Gist options
  • Select an option

  • Save AlexandreCools/be691761595e8f1da73cb0c73d3715ba to your computer and use it in GitHub Desktop.

Select an option

Save AlexandreCools/be691761595e8f1da73cb0c73d3715ba to your computer and use it in GitHub Desktop.
[MEDIUM] Strava API - Access & Refresh token - iOS 13, Swift 5 - Step 4
private func getCode(from url: URL?) -> String? {
guard let url = url?.absoluteString else { return nil }
let urlComponents: URLComponents? = URLComponents(string: url)
let code: String? = urlComponents?.queryItems?.filter { $0.name == "code" }.first?.value
return code
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment