{"action":"created","issue":{"url":"https://api.github.com/repos/dongri/OAuthSwift/issues/146","labels_url":"https://api.github.com/repos/dongri/OAuthSwift/issues/146/labels{/name}","comments_url":"https://api.github.com/repos/dongri/OAuthSwift/issues/146/comments","events_url":"https://api.github.com/repos/dongri/OAuthSwift/issues/146/events","html_url":"https://github.com/dongri/OAuthSwift/issues/146","id":116512996,"number":146,"title":"Use of unresolved identifier 'failureHandler'","user":{"login":"froggerdev","id":15814162,"avatar_url":"https://avatars.githubusercontent.com/u/15814162?v=3","gravatar_id":"","url":"https://api.github.com/users/froggerdev","html_url":"https://github.com/froggerdev","followers_url":"https://api.github.com/users/froggerdev/followers","following_url":"https://api.github.com/users/froggerdev/following{/other_user}","gists_url":"https://api.github.com/users/froggerdev/gists{/gist_id}","starred_url":"https://api.github.com/users/froggerdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/froggerdev/subscriptions","organizations_url":"https://api.github.com/users/froggerdev/orgs","repos_url":"https://api.github.com/users/froggerdev/repos","events_url":"https://api.github.com/users/froggerdev/events{/privacy}","received_events_url":"https://api.github.com/users/froggerdev/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dongri/OAuthSwift/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-12T09:40:30Z","updated_at":"2015-11-12T10:32:13Z","closed_at":null,"body":"Beginner coder here, not sure what I've done wrong but Xcode is shouting at me from this line:\r\n\r\noauthswift.authorizeWithCallbackURL( NSURL(string: \"http://google.com\"), scope: \"basic\", state:\"INSTAGRAM\", success: {\r\n            credential, response, parameters in\r\n            println(credential.oauth_token)\r\n            }, failure: failureHandler)\r\n\r\nError is as title states, \"unresolved identifier\". Obviously because failureHandler was never declared but declaring shoots out even more errors. Thanks for any advice in advance."},"comment":{"url":"https://api.github.com/repos/dongri/OAuthSwift/issues/comments/156064286","html_url":"https://github.com/dongri/OAuthSwift/issues/146#issuecomment-156064286","issue_url":"https://api.github.com/repos/dongri/OAuthSwift/issues/146","id":156064286,"user":{"login":"phimage","id":8875768,"avatar_url":"https://avatars.githubusercontent.com/u/8875768?v=3","gravatar_id":"","url":"https://api.github.com/users/phimage","html_url":"https://github.com/phimage","followers_url":"https://api.github.com/users/phimage/followers","following_url":"https://api.github.com/users/phimage/following{/other_user}","gists_url":"https://api.github.com/users/phimage/gists{/gist_id}","starred_url":"https://api.github.com/users/phimage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phimage/subscriptions","organizations_url":"https://api.github.com/users/phimage/orgs","repos_url":"https://api.github.com/users/phimage/repos","events_url":"https://api.github.com/users/phimage/events{/privacy}","received_events_url":"https://api.github.com/users/phimage/received_events","type":"User","site_admin":false},"created_at":"2015-11-12T10:32:13Z","updated_at":"2015-11-12T10:32:13Z","body":"\"unresolved identifier\" means not defined...\r\nI see, you copy readme code\r\nGo to demo to have real code \r\nhttps://github.com/dongri/OAuthSwift/blob/master/OAuthSwiftDemo/ViewController.swift\r\n\r\n```swift\r\noauthswift.authorizeWithCallbackURL( NSURL(string: \"http://google.com\"), scope: \"basic\", state:\"INSTAGRAM\", success: {\r\ncredential, response, parameters in\r\nprintln(credential.oauth_token)\r\n},  failure: {(error:NSError!) -> Void in\r\n            print(error.localizedDescription)\r\n})\r\n```\r\n\r\n`state:\"INSTAGRAM\" `is for instagram\r\nyou can generate string like that\r\n```swift\r\n        let state: String = generateStateWithLength(20) as String\r\n```\r\n\r\n\r\nThen http://google.com is not a valid callback url, it must be an url that you must handle by url scheme (see readme  and the scheme must be yourapplicationname://) or by implementing a webview and its delegate  - in final `OAuth2Swift.handleOpenURL(url)` must be call"}}