Hey Deniz,
Take a look at the start of `authenitcateNewAccount` in
https://github.com/ianyh/Highball/blob/master/Highball/AccountsService.swift. There's some stuff specific to my app, but the set up is basically universal. I'm not at a laptop, so formatting might be wrong, but here is the copied code:
let oauth = OAuth1Swift(
consumerKey: TMAPIClient.sharedInstance().OAuthConsumerKey,
consumerSecret: TMAPIClient.sharedInstance().OAuthConsumerSecret,
requestTokenUrl: "
https://www.tumblr.com/oauth/request_token",
authorizeUrl: "
https://www.tumblr.com/oauth/authorize",
accessTokenUrl: "
https://www.tumblr.com/oauth/access_token"
)
let currentAccount: Account? = account
account = nil
TMAPIClient.sharedInstance().OAuthToken = nil
TMAPIClient.sharedInstance().OAuthTokenSecret = nil
oauth.authorize_url_handler = SafariURLHandler(viewController: viewController)
oauth.authorizeWithCallbackURL(
NSURL(string: "highball://oauth-callback")!,
success: { (credential, response, parameters) in
TMAPIClient.sharedInstance().OAuthToken = credential.oauth_token
TMAPIClient.sharedInstance().OAuthTokenSecret = credential.oauth_token_secret
With "highball://" replaced with your application's URL handler as per the OAuthSwift docs.