Search code examples
iphonecocoa-touchuikituiactionsheetuiprogressview

Any way to prevent UIActionSheet from being dismissed when user clicks a button in it?


I added a UIProgressView to my UIActionSheet to indicate the download progress. So I do not want my UIActionSheet to be dismissed when user click the download button in it.

But is there a way to do that ?

Right now I implement didDismissWithButtonIndex delegate method to show UIActionSheet again after it was dismissed. But I was hoping there is a better way.


Solution

  • UIActionSheet is a modal view, which means that it blocks UI completely. Since blocking UI is considered a bad practice, preventing an action sheet from dismissing is not supported. Instead, you should make a completely separate progress indicator outside the action sheet.