Long press Wobble Effect iPhone - iphone

I have a tableview, 3 items in a cell, basically I am showing my items in grid view format with 3 columns and I am using tableview for this. This is fine. Now I want to achieve something like when I press any item on tableview/cell for long then all items will wobble and there will be small delete icon on their top left, when user press that icon then that item will be deleted, the way it happens in iPhone home screen.
Now first I want to know is how much feasible is this idea ? Like my only 2 rows will be visible at a time, and tableview reuses cell so if I scroll down and I delete any of the item then it won't create much hassle to manage delete of correct item right? And I want some direction of achieving that long press and wobble effect animation of items. What can I try?

For the wobbling effect animation code, check out this post.
And for the tableview management,you have to save the indexpath on the layer property of the view.
[imageView.layer addObject:indexpath forKey:#"indexPath"];
Now you are able to grab the cell and delete it.

Related

How can I animate this custom view transition in my iPhone app?

This is a tricky question to explain, but basically I have an app with a home screen with a bunch of circular icons on it. When the user taps on an icon, it pushes a table view onto the navigation stack. When an icon is tapped on the home screen, I want the tapped icon to stay on top of the table view as it scrolls in, and then drop onto the table view in the cell that represents it. All the other icons, however, should stay below the incoming table view, like normal. Here's a quick diagram I whipped up...
I'm about to begin researching this, I just wanted to quickly post this question in case anyone has some ideas about how I can approach this. Thanks so much for your wisdom!
Oh thats soo easy!!!
I'll try to explain my solution:
You need two sets of icons.
One set lays on Home View, second is exact location, but as a subview on main window (by default - hidden)
Once You select a button, and want to push a list - You un-hide corresponding window subview icon, and with delay - animate / shrink it to tableView corresponding location.
Once animation is finished - hide icon (instant hide will not be noticeable, as this icon will be positioned/scaled to precisely reassemble icon in tableview), and move it to default position/scale (still hidden).
That's it.
This is pretty simple, and can be done without adding second instances of your buttons. You'll use the view hierarchies z-index for this.
When you add the table view as a subview of the main view don't use addSubview, use:
[self.view insertSubview:table belowSubview:button];
Button^ will represent the button that you want to stay on top, and for your other buttons, you just have to make sure that they are lower on the stack. This way, when the table flies in, it can keep going past the button but the button will stay above it.
You can also use:
[self.view insertSubview:table atIndex:5];
On all of these buttons and the table to have total control over each objects z-index.

Show selected row always while scrolling UITableView?

Let's say we have a UITableView with some 100 rows, we select a row and after that we scroll the UITableView. The selected row is also scrolled top or bottom direction but I want the selected row to be always visible to the user while scrolling the table. Is it possible ?? please help me out which sample code..(it is same like twitter scrolling)
If you want this, you'll have to write a completely custom tableview from scratch (which I believe was done for Twitter.app). There's no way to do that with the built-in tableview.

How to invert arrow image placed before the first cell when tableview cells are swiped beyond first cell?

In my application, I need to add this functionality that there should be an arrow image upside down placed before first cell and some text like "Pull down to refresh" and when user pulls the table beyond this then this arrow gets inverted and text changes to "Release to refresh" and when the user releases his finger, the data is refreshed and rows get added to that point So now this initial arrow and text moves upwards before the first cell again.
Can anybody tell me wheather there's any event that does this? Or else which event I need to capture in order to add this functionality?
Thanks in advance.
Everything (and I mean everything) you want is here
Pull to reload tableview

Highlight table view cells when user drags across rows

I have a grouped table view that does not need to scroll. I'd like each cell to highlight as the user moves their finger down the screen and call didSelectRowAtIndexPath on release.
This behaviour can be seen done by apple in 'settings > mail > add account'?
I can't seem to replicate it myself, all I can get is the default, where the cell deselects as soon as the user moves their finger.
I think the way that that example is done is not a UITableView, instead i think they draw the "table" from buttons. This would then not allow the scrolling feature while allowing you to have the buttons highlighted.
Hope this pushed you in the right direction.
Seb kade

How mimic delete specific row in a UITableView?

I have a list of things in a table view.
When a user tap a row, I increase score. I wish provide a way to clear the score for that row.
My first try is put the table in edit mode, show the delete button to that row and proceed. However, all the other rows get blocked and can't tap again the score or tap in the disclosure button.
So, obviously this is not the way. But then I don't see what to do. Any suggestion?
You could add a button to clear the row’s score as a subview of your table cell. I suppose you’d have to put it on the left side, though, since the disclosure button is on the right.