Activity indicator not showing when executed

前端 未结 1 1861
猫巷女王i
猫巷女王i 2021-01-16 22:13

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

相关标签:
1条回答
  • 2021-01-16 22:39

    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.

    0 讨论(0)
提交回复
热议问题