Just curious, are you planning on using an alert? The reason this happens is because it gets stuck when you tap - the button remains "pushed in" since the alert is triggered before the button is "pushed out". Remove the trigger and only use the X method and you will be fine. Instead of an alert I would suggest using a popup if it is required.