title: iOS how to implement a drop down list and how to take care of closing it?
body: <p>I need some inputs on how to implement dropdown list kind of functionality in iOS.</p>
  
  <p>I have some solutions in mind like using <code>UITableView</code> for displaying the list of text items. (in my case the list could be static as well as dynamic so <code>UITableView</code> seems to be a good option for my case). But one thing I am not able to figure out is how to dismiss the dropdown...</p>
  
  <p>Let's say there is this dropdown list open somewhere in a view (let's say this view occupies the complete screen). The dropdown, once opened, should get dismissed (closed) when I tap somewhere else in the view, like the way a typical dropdown works in desktop environment. How do I do that?</p>
  
  <p>One way is to listen to <code>touchesBegan</code> events on the view and see if the dropdown is open -this is fine but problem is if I have things like button and when user clicks on one of them then I don't receive the <code>touchesBegan</code> input on the view.</p>
  
  <p>How do I go about solving this in a generic way?</p>