I have a UIView subclass which is displayed once i click navigation bar button. I’m trying to imitate a UIPopover kind of view in iphone.
The thing i’m stuck with is that i have to remove the subview when touched outside the box.
Any suggestions?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can have an invisible layer over all the layers to check for the touches whenever your subview appears, and you can manually check if the coordinate is in the subview then just manually remove it from your main view.
You can see an example here to dismiss the keyboard instead of removing a view:
http://www.ke-cai.net/2011/05/tap-background-to-dismiss-keyboard-for.html