ios - how to show suggestion for UISearchBar search? -


i making demo weather app, , inside using uisearchbar can user entry city name, don't know how display suggestion that.

for example, if user enters "lon" there should cities name suggesting start "lon" london, etc.

uisearchbar has own delegation protocol uisearchbardelegate, method -

-(bool)searchbar:(uisearchbar *)searchbar shouldchangetextinrange:(nsrange)range   replacementtext:(nsstring *)text 

make possible while editing operations, here can put nspredicate see if inserted text has city beginswith or contains entered text.


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -