Displaying suggested locations in UITableView
Basically what I want to do in my app is have a
UISearchBar which, when I write in, will feedback location results and populate that into a UITableView that appears. I see one more question on this site:
Display Locations on UITableview
But that really didn’t help me, no answer helped me at all, and they were quite vague.
So, my question is. You know how some apps maybe you have to type in a city or country, but the user might not be able to fully spell it, so based on your
UISearchBar results, it presents a TableView with the suggested cities. So say I am about to write Singapore, I don’t know how it is spelled. So I write:
And BAM, a UITableView below pops up with different options/cell titles, including a cell that suggests ‘Singapore’. Then I click on that cell and then my search bar is autofilled with ‘Singapore’. Here is a screenshot example of what I want to do with a current app called ‘iChangi’ on the Singapore app store:
So I understand I should implement the
UISearchBar delegate where the text changed, but what I want to know is there an API or database I can query to feedback the suggested cities? And how would I go around doing this, can you provide me with a tutorial on it or simply state a few steps.
- CloudKit share Data between different iCloud accounts but not with everyone
- how to print value of object in an array in swift, not its location
- loading NSBundle files on iOS
- Customizing UILocalNotification's alert
- AudioQueue how to find out playback length of queued data
- Is it possible to deactivate collisions in physics bodies in spriteKit?
5 Solutions Collect From Internet About “Displaying suggested locations in UITableView”
With the Help of Table view and search bar you can create presentation of City list. Now about API for city list there is many link availibale on Map for same. Please refer below
Download Table from above URL and place this with resource directory and use this for suggestion.
See more link for same
I know it’s quite late, but maybe it can help others,
I’ve recently created
autocomplete view, which can be attached to any
UITextField, with single line of code. Colors, separators, margins can be configured. Ships with google locations completion source.
You can clone it from GitHub
It looks like you want a UISearchDisplayController.
Apple has a quite useful Table View Programming Guide.
- does my app display second time notification iOS 9
- How to change time and timezone in iPhone simulator?
- I won't be able to return a value with Alamofire in Swift
- iOS: Custom permission alert view text
- I need an equation for equal movement along an ellipse
- iOS APNS: sending the device token to the provider in string format
- How to build against older iOS versions with the latest Xcode downloads?
- What player can be used to play transparent video in xcode for playing it in ipad?
- iOS – Custom table cell not full width of UITableView
- UITableView within UIScrollView using autolayout
- This class is not key value coding-compliant (with storyboard)
- Type does not conform to protocol 'URLRequestConvertible' with Alamofire
- How to convert points to radians in Objective-C?
- InputAccessoryView docked at bottom