Advertisement
Guest User

Untitled

a guest
May 25th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. func checkFields() -> Bool {
  2.  
  3. if((!loginPasswordTextField.text!.isEmpty) && (!loginPasswordTextField.text!.isEmpty)){
  4. return true
  5. } else {
  6. print("Empty Field was found")
  7.  
  8. return false
  9. }
  10. }
  11.  
  12. func displayMessage(errorMessage:String?, fromViewController:UIViewController){
  13.  
  14. let titleMessage = "Error"
  15. let alert = UIAlertController(title: titleMessage, message: errorMessage, preferredStyle: .Alert)
  16. let actionOK = UIAlertAction(title: "Ok", style: .Default, handler: nil)
  17. alert.addAction(actionOK)
  18. fromViewController.presentViewController(alert, animated: true, completion: nil)
  19.  
  20. }
  21.  
  22. self.displayMessage(error.localizedDescription, fromViewController: self)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement