0
我有一個UIAlertViewController需要一段時間來呈現,並且一會兒它就像一秒鐘左右..代碼如下。UIAlertViewController在實際呈現之前顯示一點延遲
PFUser.logInWithUsernameInBackground(usernameTextField.text!, password:passwordTextField.text!) {
(user: PFUser?, error: NSError?) in
if user != nil{
self.performSegueWithIdentifier("toMainView", sender: self)
} else {
let alert = UIAlertController(title: "Error", message: "Entered User Creditinials Are Incorrect. Please Try Again.", preferredStyle: UIAlertControllerStyle.Alert)
let action = UIAlertAction(title: "Ok", style: UIAlertActionStyle.Default, handler: { (action: UIAlertAction!) in
})
alert.addAction(action)
self.presentViewController(alert, animated: true, completion: nil)
}
}
預先感謝您:)
沒有工作:/ – Haidous
你的代碼是真的,沒有問題,就像我說的UIAlertController立即彈出我的。您的其他流程是否即時?也許你有互聯網連接問題?有時候解析這個。 –