开发者

Differentiate between address, city, state, zip in UISearchBar

One of the parameters my iOS application must meet is searching in full or partially by address, city, state, and zipcode.

I cannot depend on users using commas to separate the data. I also do cannot scan a string for a zip code since the street number could potentially be 5 digits.

I was wondering what 开发者_开发问答standard practice was used to analyze this sort of input. Any help or reference would be greatly appreciated.


One (slightly inefficient) way of doing this would be to make a call to Google's Geocoding API. You'll get results with address component types, such as street_address, postal_code, administrative_area_level_n, etc.

Hope this helps!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜