ios - Is it possible to block execution of my code until UIAlertController is dismissed? -
is there anyway wait user press button dismiss alertcontroller in swift 3, using dispatchqueue or else?
you mean this?
alertcontroller.displayandwaituntildismissed() // line reached after alert controller dismissed print("alert controller dismissed.")
theoretically, yes, use dispatch semaphore block until alert dismissed. it’s bad idea – can’t think of scenario acceptable. accept have deal asynchronously, executing desired code in alert controller action.
Comments
Post a Comment