TableView Collapse/Expand with sections - ios

Question related to UITableView collapse and Expand mode with dynamic sections. We got the requirement of showing the number of cells which has the collapse and expand option and once user expand the cell which will be having the list of sections and cells.
For more info I am attaching the screenshot, and please suggest me the best approach.

There are plenty of libraries available for this and many more other requirements,check out this cocoacontrols

Apple has made a demo, the key is to manipulate your section header, detail check this
https://developer.apple.com/library/ios/samplecode/TableViewUpdates/Introduction/Intro.html

Related

How to Expand/Collapse Collection view section in Swift?

How to expand/collapse Collection view section by taping on the header of collection view in Swift?
I guess you want to show section only, and expand/collapse cells.
Then You can treat your section as a particular cell, once you want to expand/collapse, add/remove data and then call "reloadRowsAtIndexpaths" method.
Late to the party, but I guess there is some 3rd party work done on this over here
The basic idea is to roll out your own UICollectionViewFlowLayout subclass and proceed from there on. But as you can see in the repo, the devil is in the details.

expandable cells table view best practice for ios

For the iOS we are not been provided any expandable list view as a component. so to use the expandable list we are having 2 basic options:
Option-1: Table header as the main view and then clicking on it open cells under that header.
Option-2: Cell as the main view and add more cell below as if its sub cells when clicking on any of the cell.
And more than this 2 different developer uses different logic. so Can we know that which would be the best practice to use expandable/ collapsable Table view in iPhone/iPad application.
Thanks in advance. This could be consider as a knowledge sharing or better coding practice related question.
There are a million ways you could do this.
In the past I have created a custom "stretching" cell that would stretch its own size to show items that were hidden. This could be a way of doing it.
What you would need to do is have a cell that when clicked, opens up (revealing a new cell hidden underneath it). You could also have it seem as if there is another cell being shown below the clicked index, but in reality you are only adding a new cell at cell_index_clicked + 1.
Hope this helps you think it out.
Use iOS 8 auto layout ..........

UITableView with a plain listing but make the section header be like a grouped listing

I am using a UITableViewController with a plain style. I like how the cells expand to the edges of thew view, but I hate how the section titles stick to the top.
Is there a way to have section titles behave similar to how a grouped listing works?
What about using grouped style but removing the left and right margins. Possible?
I think this question might answer you. One awkward way of achieving this is not using the UITableView sections and draw cells instead with your a custom design.
You could always create a custom cell with the appearance of a section header. That's what I've done in the past to for these kinds of scenarios, that way it won't stick to the top of the view. This of course requires additional logic such as disabling section headers and and using your new custom section header as a single celled section in your table view, if you catch my drift. It's actually not that hard and gives you good flexibility.

Is there a option to add a new row in shinobi grids?

First of all i am using shinobicontrols for developing interactive UI controls (Grids) for iOS using Objective c and please don't suggest me some other controls as an answer because i need to use only this.
I am half way stuck while using this control. i have downloaded demo code for grids provided by shinobicontrols (trial for 30 days). from : http://www.shinobicontrols.com/shinobigrids/product-tour/get-started-quickly-and-easily/
I was able to reorder rows and columns, edit contents of cell, re size column width by pinch gesture and much more.
But i couldn't add a new row or column to the existing grid. Just wanted to know whether this can be achieved.
Thanks in advance.
Edit the datasource (add/remove) item and just do [grid reload];
I think this should do.
The above answer seems to be correct. Adding my views Shinobi grids can be considered as UITableView cells, If you simply change the data source array of the tableview and call [tableview reloadData], number of cells displaying on the view will also change. There is no option to add a row still.
Look at this one. It is in alfa stage, but it will be quite a powerful in month or two, I would say. Any suggestions are welcome and it's free, of course. Number of rows and row content is fully controlled from delegate, so it is dynamic.

UITableViewCell- controlling movement

When editing my UITableView, I give the option to move cells to reorder the data. However, The top two cells in the table are cells that give information about all of the cells in the table, and I dont want the user to be able to move information cells into that section. Here is a picture of the problem:
The user shouldn't be able to drag the cell titled 'This is bad!!!' into the section with the 'Total:' and 'New Group...' cells. Is there a way to control this functionality? I haven't seen a delegate method that does this, but I could have missed one.
Edit: oops! I just saw that someone else has asked the same question on SO, so I'm going to post the link and close this question. Thanks #fzwo for your help.
How to limit UITableView row reordering to a section
tableView:targetIndexPathForMoveFromRowAtIndexPath:toProposedIndexPath: from UITableViewDelegate is what you're looking for.
In your concrete case, you could also display the header information in the actual tableView.tableHeaderView. This scrolls like an ordinary cell, but isn't a cell. It would probably also make sense from a UI perspective, because it is something different than your ordinary cell content.

Resources