In the first image of your question, you show the UISearchDisplayController used. To achieve this accurate animation, you will need to use the UISearchDisplayController and change its UISearchBar so that it looks like the custom one you made. You can drag the UISearchDisplayController into the Interface Builder and then use the code to change its searchBar property.
self.searchDisplayController.searchbar will be what you change if everything is configured correctly in the BUilder interface.
source share