Skip to content

Instantly share code, notes, and snippets.

@sheafk
Created March 28, 2017 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sheafk/9787ae3b012d9ea065794b1a1d60be10 to your computer and use it in GitHub Desktop.
Save sheafk/9787ae3b012d9ea065794b1a1d60be10 to your computer and use it in GitHub Desktop.
IBAction to authenticate Pinterest users in a Swift App
@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