iOS Instant Search - Close/Cancel Button Action

I’m using InstantSearch for iOS with a SearchBarWidget.

I’d like to dismiss the currently view controller when the cancel button is pressed.

Is there a way to call a function when the cancel button is pressed?

UPDATE: Use the SearchViewModel (not released in current version of Pod as of 12/11/17).