-
-
Save fitomad/1c41dfc68fc69f28d4dd204687de8b32 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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