1
for conflict issues between two frameworks, I had to pass the login code from facebook to a helper class, however I’m not sure how to redirect the user to the main screen of the app after the login is done, Someone there can give me a solution for that?
@IBAction func loginFacebook(sender: AnyObject) {
let util = Util()
util.loginFacebook()
}
/*Método na classe util*/
func loginFacebook(){
let permission = ["public_profile"]
PFFacebookUtils.logInInBackgroundWithReadPermissions(permission)
let requisicao = FBSDKGraphRequest(graphPath: "me", parameters:["fields":"id, name, gender,age_range, email"])
requisicao.startWithCompletionHandler { (connection, result, error) in
if error != nil{
print(error)
}else if let resultado = result{
let dados = resultado as! NSDictionary
// redirecionar para pagina principal junto com os dados
}
}
simply Voce use the method
self.performSegue(withIdentifier: "coloca_aqui_o_ID_da_segue", sender: nil)
that it goes to Viewcontroller determined by the following ID– Leo Dabus