Instantly share code, notes, and snippets.

Embed
What would you like to do?
TraktTVClient.shared.appendToWatchlist(show, handler: { (validOperation: Bool, error: TraktError?) -> Void in
if validOperation
{
...
}
else if let error = error
{
if case .unauthorized = error
{
// No estamos autorizados a acceder a los datos del usuarios
// Vamos a pedirle que nos autorize
if let oauthURL = TraktTVClient.shared.authorizationURL()
{
let safariController = SFSafariViewController(url: oauthURL)
DispatchQueue.main.async
{
self.present(safariController, animated:true, completion:nil)
}
}
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment