Highlight table view cells when user drags across rows - iphone

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

Related

iPhone / iPad UITable Swipe to Delete Resizes / shifts Cell

Is there anyway to turn off the Swipe to Delete resizing / shifting the cell? There is a custom cell that we are using that has a UIImageView as part of the cell display. When the swipe is done, it shifts to the left which is what we don't want. If we turn off autosizing in the IB, then the UIImageView does not shift, but then rotate is broke (UIView will not autoresize).
There are probably other ways around this, but was wondering if one can turn off the swipe to delete shift cells.
Ort11, don't touch "autosizing" (this is related to resizing when, for example, rotating - at least, that is what I think you mean). Instead, look at the UITableViewDelegate protocol. There is a method tableView:shouldIndentWhileEditingRowAtIndexPath:, for example. There also is a method to prevent editing for individual cells, in case you want to. All the best -
Perhaps this is what you're looking for?
UITableView disable swipe to delete, but still have delete in Edit mode?
In that you can no longer swipe to delete the cell, but you can still perhaps delete the cell by hitting the edit button.
Of course - this may not help with the moving of the cell parts; when the delete button appears on the cell the contents will still shift. You can override -(void)layoutSubviews in your UITableViewCell, to customize how the delete button will be positioned (more here: iPhone UITableView - Delete Button)

Select multiple rows in UITableView with dragging finger

I would like to ask if it is possible to select multiple cells by dragging my finger on the cells I want to select. For example when you are cropping a picture, you are dragging a line with your finger and I want to have a similar effect.
I can also consider using other UI elements rather than a UITableView, open to suggestions.
Thank you for your help.
You can put a transparent(view.backgroundColor = [UIColor clearColor]) overlay view above the table view when you want to select.
In this transparent view, you should set up a UIPanGestureRecognizer, and by watching events of this recogniser, especially the events for Began, Changed, Ended and Cancelled. The target object would know the range to select.

Delete cells in table view Iphone with edit button

I have a table view with different cells and basically I would like an edit button which would then make those red circle appear in each cell and be able to delete them. I already know how to make the "Edit" button appear and also I have overridden the commitEditingStyle method for the table view so I would like to know how to link the button to the action which trigers the red circle and how to make them appear and finally how to actually delete the cells thankyou :)
The editing style on your table view cells should be set to UITableViewCellEditingStyleDelete, and then you just need to make sure to call setEditing:animated: on your table view. UITableViewController can help provide a lot of this functionality pre-baked.
That's actually done through an undocumented API (though I'm not quite sure why) - using it would probably get your app rejected.
However, lots of apps simulate this functionality with their own code - you'd basically define a custom UITableViewCell subclass which changed its background color / toggled that extra red circle image when tapped, keep track of which cells had been tapped, and finally delete them all by calling deleteRowsAtIndexPaths: on the table with the collected list of rows.

iPHONE SDK - tableview, remembering how much it is scrolled?

i was wondering how do i do this?
I wish to make a tableview configured in a way that if i scroll down a tableview and click on one row, i will be brought to another view. But when i click a back button of some sort. i return to the tableview but still viewing that particular row. kinda like the iPod table in the iPhone? Remembering scrolled position?
i just want to know how to do the 'remembering scrolled position' part.
Save your index path in tableView:didSelectCellAtIndexPath: before pushing the new view, use it later. This will give you the NSIndexPath pointing at the cell that was selected by the user, not necessarily give you the same position it was at before they tapped the item. So keep that in mind.
Continue from jer's answer. You can use indexPath when calling this method in tableView:
UITableView selectRowAtIndexPath:animated:scrollPosition:

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