I have a facebook login button from their SDK and would like to change the text. I've tried this code:
facebookButton.setTitle("my text here", forState: .Normal)
but it doesn't work. Is there a way to do it?
This is what the facebook login button code looks like:
//MARK: Facebook Login
func loginButton(loginButton: FBSDKLoginButton!, didCompleteWithResult result: FBSDKLoginManagerLoginResult!, error: NSError!) {
if error == nil {
facebookAPILogin(FBSDKAccessToken.currentAccessToken().tokenString, completionHandler: { error in
if error == nil {
self.performSegueWithIdentifier("loginToHomeSegue", sender: self)
} else {
self.showAlertWithTitle("Sorry".localized(), message: "There was a problem connecting with Facebook".localized() )
print(error)
}
}
)
} else {
showAlertWithTitle("Sorry".localized(), message: "There was a problem connecting with Facebook".localized() )
print(error.localizedDescription)
}
}
//Facebook Logout
func loginButtonDidLogOut(loginButton: FBSDKLoginButton!) {
print("User logged out")
}