Search code examples
objective-ccocoauiactionsheetios7

UIActionSheet in iOS7 dismissing when user taps ANYWHERE on the screen on iPhone


I've noticed that in iOS 7 a **UIActionSheet** automatically dismisses when a user taps anywhere on the screen on an **iPhone**. This was NOT the case in iOS 6 and is leading to unintended effects. Is this a UI change? Bug? Is there a way to disable this?

From iOS 7 docs:
"As described in iOS human interface guidelines, you should include a Cancel button with action sheets displayed on iPhone and with those displayed on iPad over an open popover. Otherwise on iPad, action sheets are displayed within a popover, and the user can cancel the action sheet by tapping outside the popover, in which case you do not need to include a Cancel button."

This seems to suggest that the behavior of dismissing when tapping anywhere outside the action sheet should only pertain to iPads. But this is now happening on an iPhone running iOS 7 when it doesn't on an iPhone running iOS 6


Solution

  • Regarding your question Is this a UI change? Bug?

    It is seems like an UI change not a bug how can I say that ?
    Have a look at the image i took from iOS7 simulator
    It is a image of Maps application of iPhone. enter image description here


    When you click on button ( display in red rectangle ) one action sheet will display which have Cancel button like below
    enter image description here

    And if you click any where else it will close, same behaviour also found in other Apple applications also like safari.
    Regarding your question Is there a way to disable this?
    Sorry but i don't have answer for that.