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.
- What are the pros and cons using git VS Mercurial with Xcode for iOS development in big teams?
- Undefined symbols for architecture x86_64 in Xcode after Firebase update
- How to crop a UIImageView to a custom shape
- How do I connect a IBOutlet to a UIView?
- Xib file: Can't drag a View from a xib file to a swift file
- How do I change the WKWebview's user agent in OS X Yosemite?
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.
- How to control what the buttons in push notifications do?
- How to share all the data i have stored using sqlite database between two devices to reuse the data by dumping in another device
- Does Swift init(count:, repeatedValue:) work?
- UIScrollview content size when orientation changes
- Swift making IBOulet as strong
- Alamofire multipart upload post error in Swift
- iPhone Development: how to use custom fonts?
- Get word from long tap in a word of UITextView
- NSSplitViewController in OSX 10.10 using Xcode 6
- Prevent uiscrollview from scrolling further then certain point
- Wire a button to the pin callout
- UIButton can't be touched while animated with UIView animateWithDuration
- Run a terminal command in a Mac app with Swift Xcode
- Universal app for iPad not loading iPad .xib files?
- Why does Swift 2 favor forced unwrap over optionals?