title: How to find topmost view controller on iOS
body: <p>I've run into a couple of cases now where it would be convenient to be able to find the "topmost" view controller (the one responsible for the current view), but haven't found a way to do it.</p>
  
  <p>Basically the challenge is this: Given that one is <strong><em>executing in a class that is not a view controller</em></strong> (or a view) <strong><em>[and does not have the address of an active view]</em></strong> and has not been passed the address of the topmost view controller (or, say, the address of the navigation controller), is it possible to find that view controller?  (And, if so, how?)</p>
  
  <p>Or, failing that, is it possible to find the topmost view?</p>