UITableview custom section view move to the top - iphone

I have a UITableview where I use view for header for section method to customize the view like a drop down so that,when I select the particular button on the section header view the cell for row appears,like a drop down.I need in a way such that when I select the particular section this section should go to the top of the tableview. Is there a solution to implement this.

Related

How to create tableview that shows/hide cells when you click on section in swift?

How to create a tableview that allows user to show / hide cells of particular section when you click on that particular section in swift ??

tabbed navigation in tableview section header

I'd like to mimic the behavior of profile page of pinterest app.
You can tab on Boards/Pins/Likes(tableview section header) and, tableview changes accordingly.
Below are screenshots to illustrate this.
Suppose I can create each of the tabs(boards/pins/likes) in separate viewController.
Also suppose I want to reuse the code of each viewController because other views(such as 'following' tab on the tab bar) look very much like one of them(boards/pins/likes).
How would I share a table header & table section header and also separate codes enough so that I can reuse bulk of them?
Basically, I have two viewControllers with tableview.
Now I want to create a new viewController with a tableView header/section header that user will tab to see one of the previous two viewController's view.
I don't think the tab appear in Table Header, instead it might be a view subclassing UISegmentedControl. If you want to reuse it you can create the interface in xib file and link it with your view controller
try check this github project https://github.com/rs/SDSegmentedControl for custom UISegmentedControl

Scrolling problem with UITableView

!I have a UITableviewController with a navigation bar as header. there are 4 sections in the table, Number of rows in the table are more than that can be fit in the iphone screen. while scrolling whole view is getting scrolled!!. I want the header to be stationary and only table to be moved.
Also the last section is appearing twice! like this.
Table view controller snapshot
please help
Thanks in advance
First don't use Navigation bar as the header of TableView. You should use a navigation controller and push this viewcontroller which contains tableview. This will allow you to get rid of first problem i.e. to keep the bar steady and not scroll with the tableview.
Second problem looks really weird, it seems to be that you have laid out two UITableView in your nib. Check again and remove one.
You have two options:
1) add a base UIView on which your header view and your table view are siblings.
2) set the header view as the table view's viewForHeader of the first section
You have only one option:
1)create a UIView lets say headerView and add control or whatever you
want to have and put that custom UIView on top of your UITableView
2)Do not implement viewForHeaderInsection
3)Change the y position of your UITableView to place your tableView
below your headerView

How can I put an editable table view in a tab bar application?

I am starting out with the tab bar application in XCode and I want to put a table view in one of the tabs. I know how to physically put the table view into a tab with interface builder, but I need to be able to edit the data in the table, so I'm not just left with blank cells.
So, how can I edit the data in the table?
Essentially, I want to put a navigation-based application inside the tab of a tab bar application.
Thanks for the help!
UITableViewCells don't, by themselves, support the ability for the user to edit their content. You can set up your UI to allow users to do so, but it'll take a little extra effort.
If what you're really looking for is for the user to be able to enter text into a table cell, I would add an Edit button to your text cells, so that the user can tap it to go into edit mode for a cell.
When a cell goes into edit mode, add a UITextField to the cell view and call its -makeFirstResponder method to bring up the keyboard.
When the user taps the Done button on the keyboard, call -resignFirstResponder on the text field to dismiss the keyboard, then update your table view's data source object (this is the object you've assigned to the UITableView's dataSource property) with the string from the text field's text property and remove the UITextField from your table cell and reload the table's data by calling its reloadData method. Or if you are keeping a reference to the edited table cell somewhere, you could just update the cell object directly instead of calling reloadData on the table.
You can't just add text to table cells in InterfaceBuilder. You'll need to hook your UITableView to a UITableViewDataSource, and have that data source provide the cells you want your table to display.
Here's a great starting point: http://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/TableView_iPhone/TableViewAPIOverview/TableViewAPIOverview.html%23//apple_ref/doc/uid/TP40007451-CH4-SW2
Give this a shot http://www.amasso.info/?p=77

UITableView - how to make search bar scroll with table

How can I make the search bar to scroll together with the table view? When I scroll my table view I want my search bar to go with it and disappear. I want to have done something similar to contacts app on the iPhone.
You can place your searchbar in the tableView's header row. This will make it part of the tableView.
Set up an empty table section, above or ahead of all other sections in your table view. Set this section's header to be your search bar view.