title: Getting interactivePopGestureRecognizer dismiss callback/event
body: <p>Is there a clean solution on getting a callback or event on the view controller being dismissed (popped) by an <code>interactivePopGestureRecognizer</code>?</p>
  
  <p>To be clear I need some explicit method getting called on the top most controller (and no other) before the controller will be popped by this gesture recogniser. I do not want to get the event on the navigation controller and send the event to the appropriate controller and I do not want to use <code>viewWillAppear</code> or <code>viewWillDissapear</code>...</p>
  
  <p>The closest thing I have is adding a target/selector pair to the gesture having only 2 problems. First I can't get a direct information if the controller will be dismissed or not (<code>UIGestureRecognizerStateEnded</code> will fire in any case). Second after the controller is dismissed I need to remove the target from the recogniser.</p>
  
  <p>The reason for this is I have a few controllers that need to send some information to their delegates. With having "done" and "cancel" buttons the event is triggered, delegate methods get called and then the controller is popped. I need pretty much the same to happen with as least changes to the code as possible.</p>
  
  <p>Another situation on this gesture is possibility of throwing an alert view and reverting the action: Is there a way of showing alert view when this gesture ends asking like "are you sure you wish to cancel your work" and have the user choose if the controller will be popped or brought back.</p>