Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 2
    possible duplicate of Prevent dismissal of UIAlertController Commented Mar 7, 2015 at 20:45
  • Thanks @LyndseyScott thats not a true solution to my question. That just prevents a button being enable based on the textfield having text in it : here is their solution : = (tf.text != "") that just disables the button from allowing the view from being dismissed eventually Commented Mar 7, 2015 at 20:47
  • But I think most relevant part of that answer is selecting a UIAlertAction will dismiss your alert. If you want some other behavior, try creating your own custom view. Commented Mar 7, 2015 at 20:55
  • Yeah @LyndseyScott i agree, I was just hoping someone had an alternate solution before I went that route, theres creative people out there. I looked at that question prior to posting, their main intent wasn't to prevent a dismiss it was to ensure text validation per their comments. Commented Mar 7, 2015 at 20:57
  • 3
    I can't upvote your post enough. I'm in the same situation where I need to validate textbox and prevent alertbox from being dismissed when validation fails. The problem is that alertbox is dimssed right after user taps on the trigger button and my validation logic is inside that button tapped event handler. Seems that I have to build custom alertbox to resolve this. Commented Sep 23, 2016 at 11:51