Operations After UIAlert is dismissed causes dealays
<p>I am currently making a registration form for my App. Once the user hits the register button a alert is given to the user to to confirm the number and proceed. </p>

<p>Screenshot of Alert: </p>

<p><a href="https://i.stack.imgur.com/PielO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PielO.png" alt="enter image description here"></a></p>

<p>If the user hits cancel I perform the following operations: </p>

<pre><code>/*** Reset Mobile Number Input ***/
                        self.flagMobileNumber = 0
                        self.validatorIconMobileNumber.setImage(nil, forState: UIControlState.Normal)
                        self.mobileNumberInput.text = ""
                        self.mobileNumberInput.becomeFirstResponder()

                    /*** Disable Register Button ***/
                        self.registerButton.alpha = 0.5
                        self.registerButton.userInteractionEnabled = false
</code></pre>

<p>But there is a considerable delay that occurs before all the operations are completed. </p>

<p>May someone explain why this happens and what can be done to prevent it. </p>