I use OAuthSwift and whenever I run this function
func doOAuthTwitter(){ let oauthswift = OAuth1Swift( consumerKey: "...", consumerSecret: "...", requestTokenUrl: "https://api.twitter.com/oauth/request_token", authorizeUrl: "https://api.twitter.com/oauth/authorize", accessTokenUrl: "https://api.twitter.com/oauth/access_token" ) oauthswift.authorize_url_handler = WebViewController() oauthswift.authorizeWithCallbackURL( NSURL(string: "oauth-swift://oauth-callback/twitter")!, success: { credential, response in self.showAlertView("Twitter", message: "auth_token:\(credential.oauth_token)\n\noauth_toke_secret:\(credential.oauth_token_secret)") var parameters = Dictionary<String, AnyObject>() oauthswift.client.get("https://api.twitter.com/1.1/statuses/home_timeline.json", parameters: parameters, success: { data, response in let jsonDict: AnyObject! = NSJSONSerialization.JSONObjectWithData(data, options: nil, error: nil) println(jsonDict) }, failure: {(error:NSError!) -> Void in println(error) }) }, failure: {(error:NSError!) -> Void in println(error.localizedDescription) } ) }
function seems to work up to this point
oauthswift.authorize_url_handler = WebViewController()
authorizeWithCallbackURL doesn't even start, and jsonDict does not print. I tried my passcodes through an OAuthSwift demo and it works great with tableView by printing a JsonDict. I have no idea why authorizeWithCallbackURL is completely ignored when I use it outside of the demo.
source share