cell animation, uitableview cell - iphone

I was downloading an Pizza pizza application for IPhone. There is very cool animation for a cell.
If you click on particular cell, it will expand down and show you more controllers.
Please look at link1 (first state ) and at link2 (second state when you are clicking on the cell)
Question : what is the right way to achieve this animation.
Please advice me on this issue. Any comments are welcomed

There is nothing new about this animation. Its pretty straight forward, and it will just depend on how you want to effect this change.
For example, start off with the cells as shown in your first image. Touching a cell will call the -didSelectRowAtIndexPath, and you will need to increase the size of the cell, and provide the new cell (which is the image of the second link). Call tableView reloadData to effect this change. UseUIAnimation that will animate the cell from your first state to second state for a period of 0.5 seconds (how fast you want it to be)
Make sure that during the animation period, your cell is NOT selectable.
cell.userInteractionEnabled = NO
You can do this with other animation frameworks, but UIAnimation should do the trick. (Refer to examples of UIAnimation if you need help with it)

Every cell you see is a section Header View with button.When you touch the button,the table reload data in this section,then you can see the real cell view in this section. The cell view is a custom view with a lot of controllers.

Related

drag and drop from uitableviewcell to uiimage view in ios

I need help implementing a drag and drop gesture, I would like to know Your opinion to find the best approach.
I have a view controller with a uitableview on the right and some image views on the left.
I would like to allow the user to drag every cell of the table view on one of the image views. Basically the drag-n-drop will fail if the cell is not released on one of the image views, otherwise the image view will change image according to the dropped cell.
What do You think is the best way to achieve this?
In addition, when the user start dragging, I would like that he drags around a particular shaped subview, with image and data, not drag the semitransparent cell.
Thanks,
The basic steps for this would be:
Add a long press gesture recognizer to your table view (the whole view, not individual cells)
When the gesture begins, find which cell it is over (convert point, then user indexPathForRowAtPoint to get the cell)
Make a copy of that cell which will become the dragged view (take a snapshot, add it to a UIImageView and add that to your main view). Or you could make the view look however you want if you dont want it to look like the cell
make your original cell hidden so it looks like it is being dragged
On gesture changed, move teh position of this image view based on locationInView of the gesture)
On gesture ended, check to see if the cell is over an image (hitTest: for this) and do any animations or calculations you need.

How to show custom options on swipe table cell in a simple way

I am working on a app which includes table cells. I want that when i swipe table cell it shows two options, first about that cell value and another for delete that value. How can i show that in a way that the cell value shows in half of cell and the options show in half of cell.
Thanks in advance.
There are an out of the box solution, called HHPanningTableViewCell. It does exactly what you need!
HHPanningTableViewCell is a UITableViewCell implementing "swipe to reveal" a drawer view. Such a view typically holds action buttons applying to the current row.
This library, SWTableViewCell, should help you:
https://github.com/CEWendel/SWTableViewCell
An easy-to-use UITableViewCell subclass that implements a swipeable content view which exposes utility buttons (similar to iOS 7 Mail Application)
You have to create a custom cell and override Apple's behavior which is swipe left to delete and then show your options. You can add gesture recognizer to the cell and on swipe to left animate the cell content view and animate in your option view or however you like it to be. I can write up an example code if you need.

UITableViewCell animation - displacement during animation

I am implementing an animation on my UITableView. Whenever I tap on my section I want all the rows under that section to collapse with an animation. A tap again will bring them back animated.
This is what I am doing:
Putting a tap gesture recognizer on my table sections & on the
handler I am setting the table data sources accordingly.
After setting up correct data sources I am calling following code,
here aTag is the section index tapped.
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:aTag] withRowAnimation:UITableViewRowAnimationBottom];
Here, the problem I am facing is that when rows are animating I see them animating in wrong frame. My section header also animates from above & the whole animation looks displaced by height of section header. Once animation is done, everything is at correct place. It is just during the animation I see a little weirdness of animation displacement. So, ideally, only cell should animate & not the section & cell should animate from its position without any displacement.
Any idea what needs to be taken care of here.
This is a UITableView bug. I spent a technical support ticket, and they told me to report it as a bug. Bug ID# 12498611.
The solution I've come up for this is:
scroll the cells first out of the view
update the backing data
reload the table, as not to animate the cell removal
scroll the table (without animation) to compensate for the missing cells
There are some edge cases for which you have to ensure that the content offset doesn't become negative or overshoots the content size. For this rectForSection is your best friend.
Hope this helped.

Expanding a UITableViewCell with CoreAnimation

I'm trying to expand a UITableViewCell to fill the entire screen using CoreAnimation.
How can I animate a TableViewCell so that it looks like the cell is expanding to fill the entire screen?
I will then push another ViewController in the completion block of the animation (without the user noticing).
I don't think it's possible to take the actual cell and expand it to fill the screen, because the TableView is managing the cell and could respond rather poorly to the cell's size going crazy all of a sudden.
What I would do is make a 'copy' of the cell using your own class extending UIView, display the copy directly above the cell of the table view (let me know if you need details on that step or if you can figure it out yourself), and then animate that to fill the screen.
For tips using CoreAnimation and layers, go try google - there's a lot out there already on the subject.

Is it possible to expand the table view's cell at run time?

I am developing an iphone application .
In which i want to show some detailing by the means of expansion of that cell (i.e. by the means of touching the cell it should animate and exapnd and show the details) and in that show the details related to selected row.
What you could do is:
cell is tapped, do a transform on the cell's view to expand it. Fade it out while fading in a new fullscreen view that has some similarity but has the extra data you want displayed. When you are done with that view, shrink it while fading out and fade in the cell view again.
have to update the height of the cell.....