I am trying to display an activity indicator when the user hits the login button. If I put the startActivityIndicator()
code in viewDidLoad()
it sh
Using my delay
utility (see here: https://stackoverflow.com/a/24318861/341994), rewrite like this:
@IBAction func btnSignIn(sender: AnyObject) {
startActivityIndicator()
delay(0.1) {
if validateEmailAddress(txtEmailAddress.text!) == false {
// ... everything else goes here ...
}
}
The delay gives the activity indicator a chance to appear and start spinning.