Custom tableview of search display controller - ios

I do not like the tableview comes with the search display controller, as I want to make some kind of pull to refresh/loadmore to the table, so I was wondering if the tableview can be customized?

This question appears to be answered in custom-class-for-uisearchdisplaycontrollers-table-view
tl;dr You can't get UISearchDisplayController to use a custom table view. If you don't need iOS 7 compatibility, use UISearchController instead.

Related

Show typeahead popover while user is typing

I'm trying to do something like the following:
As you can see, a popover shows up as you start typing, and updates the results as you type. My question is regarding the UI and how to actually implement it.
How can I show a custom popover when the user starts typing? Is it possible to load a custom view into a popover? Additionally, what would I need to do if I wanted to also include an image view in each typeahead result?
Good question, which most beginners have. Follow my instructions given below.
First create a view controller and design it as you wanted it to be and include a Search Controller and implement it's delegate functions in the view controller.swift file(Hope you know to work with delegates for controllers,else just google it...It's pretty easy).
Then add a Tableview in center of the view for viewing the results like shown in your question & and add a custom cell into the table view and then setup a custom class file for that cell exactly like how you works with tableview controller.Use just the basics of tableview stuffs.
Setup outlets and all for the controls and buttons.
Create an array named 'filteredResults' or name it as you like to reload the tableview data whenever the text is changed in search bar.
To detect and call your function while user changes text in search bar,You can use didTextChanged delegate function of search bar.
Note though that it's better to find everything else by your own so that you feel confident about yourself when you solve the problem at the end.

What controls does the built-in contacts app use?

In iOS, the built-in contacts app looks similar to what's displayed on this example page. What controls are being used to create the initial view? Is it a table view? If so, how is the image on the left offset from the two rows?
What's happening behind the scenes to switch this view into edit mode? Are labels being replaced with textboxes or are the textboxes simply being set to editable?
There are 2 ways to do things like this that I know
#1. That is UI TableView, but TableView with a custom TableView Header.
Also it is UITableViewStyleGrouped
Just Init and setup the view include a UIImageView On the left side and three UITextField on the right side.
like this
|----------| |---TextField---|
|---Image--| |---TextField---|
|----------| |---TextField---|
and set this view with:
self.tableview.headerView = yourViewWithImageAndTextField;
2. Just try to use Apple's own ABPersonViewController
Apple's sample
Documentation
Good luck to you
This looks like an pre iOS7 UITableView in UITableViewStyleGrouped style, and a probably a custom cell to handle the image.

Submenu in a tableview controller

I'm creating my first app for iOS, and I need something like a submenu for showing data for specific dates, one just like in the last image of the TextHog app http://itunes.apple.com/us/app/texthog/id343405995?mt=8. The menu under the Navigation controller where u can switch between months. How can i achieve this ?
Use UISegmentedControl to make it look like TextHog. You can use it inside and outside tableviewCell. This question may help. How to use UISegmentedControl with UITableView

How to display a UITableView when UISearch is clicked.

I am creating an app and need the user to select an activity. I want them to be able to search through the activities as there are a lot in the list. I want to just have a search bar on the main view,(with placeholder text that says select activity.) When they click in the search bar, I want a table view to appear with the list of activities, and then I want them to be able to search the table view. I know how to do the search features of the search bar but I don't know how to make it pull up the table view, or how to dismiss the table view after they select one. And I want it to display the name of the activity in a label after it is dismissed. Any suggestions will help.
Thanks!
You should use UISearchDisplayController it makes things much easier.
It manage the second UITableView so you don't need to do it yourself.
To dismiss the search table view when ever you want, call - [mySearchController setActive:NO];
Take a look at those tutorials
Implementing A Basic Search with UISearchDisplayController and Interface Builder
UISearchDisplayController with NSPredicate

UISearchDisplayController - I want a grouped table

I added a UISearchDisplayController using the interface builder in XCode 4.2, and it added a UITableView automatically.
The problem is that i want it to be grouped table, but i couldn't find how to change it.
Got any ideas?
Well you can't change it.
If you want to use a grouped table, forgo the UISearchDisplayController and use a combination of UISearchBar and new UITableView instance. You can create this table view programmatically or using Interface Builder.
Either ways attach it to a searchTableView property and keep it off the view hierarchy. When the search begins, attach it to the view hierarchy and lay it over the original table view.
This will involve a good deal of additional work but if you want it a grouped search table, this is the way to go.

Resources