Created
March 28, 2017 15:41
-
-
Save sheafk/9787ae3b012d9ea065794b1a1d60be10 to your computer and use it in GitHub Desktop.
IBAction to authenticate Pinterest users in a Swift App
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
@IBAction func authenticate(_ sender: AnyObject) { | |
PDKClient.sharedInstance().authenticate(withPermissions: | |
[PDKClientReadPublicPermissions, | |
PDKClientWritePublicPermissions, | |
PDKClientReadRelationshipsPermissions, | |
PDKClientWriteRelationshipsPermissions], from: self, | |
withSuccess: { (response) in | |
self.pinterestLoginSuccess = true; | |
print("User authenticated!)"); | |
//TODO: If true, will move user to BoardsViewController | |
}) { (error) in | |
print("Error authenticating \(error).") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment