create custom delete button for uitableview - iphone

Im working on an ios app and my question is how to change the default button on swipe to delete on a uitableview. i see i can change the text with titleForDeleteConfirmationButtonForRowAtIndexPath but i want to change the image completely. ive been looking around for a way and all the posts about it may be out of date so just want to confirm with people before i go ahead with this. What im going to do is add a gesture recogniser to the cells themselves to catch the users swipe on individual cells and then add in my custom button and re arrange the cell frame from there and just forget about apples default swipe to delete completely. how that sound?

Here is a great open-source class for doing exactly this, based on the behavior of the Twitter app:
https://github.com/thermogl/TISwipeableTableView

Related

Is Selecting Multiple Items with a Two-Finger Pan Gesture only possible with UITableViewController?

I tried implementing the selecting multiple items with a two-finger pan gesture. However, the checkmarks didn't always appear and disappear when tapping edit to start the process, or tapping done when finished.
I later discovered that it works fine when using a UITableViewController after choosing the different controller from cocoa touch menu, instead of the UIViewController and UITableView I was using before.
So my question is: is it correct for me to now assume that these gestures when used in a table are really meant for a dedicated table view controller (with all the extra functionality you only get from it)?
Without any example code, I can't really see what might be going wrong. Have a look at the documentation to see if you are implementing it correctly.
https://developer.apple.com/documentation/uikit/uitableviewdelegate/selecting_multiple_items_with_a_two-finger_pan_gesture

UITableview with UIPageControl?

I am in the making of a restaurant "step by step" ordering app, where I want to list the menu (appetizers, main course etc) in a tableview with the ability to organize the menu contents with a UIPagecontrol. Something similar to the eat24 app way of doing it or how the weather forecast app is constructed.
I already have the tableview set up, now I just need to implement this, which I hope you will help me with or guide me in the right direction, for me to accomplish this :). Would I need to setup a tableview for each of the categories or would it be possible to just update one tableview with the needed information, by swiping to the left or use arrows in a toolbar in the picture? What would the best way to add a toolbar like the one picture (white ring), using the storyboard -> resize tableview and drag the image in or to set it up programmatically?
Option 1 - Updating your tableView
You may update your dataSource so it reflects the state of the "new" tableView. Than you call reloadSections:withRowAnimation: by using UITableViewRowAnimationRight or UITableViewRowAnimationLeft, depending of whats fitting at the moment. This will feel like scrolling to a new tableView. For swiping you could use a UISwipeGestureRecognizer.
Option 2 - Using a scrollView with multiple tableViews
If you want it a little bit easier just setup three tableViews and throw them in a UIScrollView with paging enabled.
PageControl
Of course you need to add and setup a UIPageControl, if you want to show those dots.
Regarding the UI:
You can setup everything in your Storyboard. The background, the arrow buttons, the UIPageControl, you can even add the UISwipeGestureRecognizer within the Storyboard.

How to realize the same effect like iPhone's homescreen

I want to add some custom buttons and realize the same effect like the iPhone's home screen. What I can think of is to calculate the position of each button and add them to the view. Are there any other ways to do this? e.g. add buttons to the tableview
Check TTLauncherView from Three20,
I realized the same view of the thumbnails in the photo app (which in principle differs only because of the background color and the rounded effect of the buttons) using a custom cell (with 4 UIButtons inside) in a normal tableview.
In my case, this is because I need to scroll up and down, in your specific case there should be a way to "lock" the table from scrolling. By the way, for this reason, it could be simpler to design the custom view in the interface builder, it is very quick to design such a view, and then create a custom controller to provide simple methods to assign icons and actions to the UIButtons dynamically.
You could also look at the Three20 libraries as already suggested, it is already implemented, but you app will easily be rejected by Apple if you do so.

UIPicker swipes not responding

UIPicker swipes where responding perfectly in the Iphone simulator with SDK 2.2, but i am now testing with a new version of the simulator, and swipes are not working. I went trough the documentation and i cant see any changes on the API. So im asumming that something is wrong and the SDK 2.2 is letting me get away with it.
The Picker uses custom views to display an image and text beside it. The picker does change position correctly when you do a single tap on a row of the Picker. But if you try to swipe it does not respond (sometimes it moves a few millimeters). I thought the custom view for each row was not letting the picker detect the swipes, so i added self.userInteractionEnabled = NO in the custom view, but it hasn't made any difference.
Your help would be appreciated,
Thanks
The problem is that the UIPicker is inside a UIScrollView. To fix it set the UIScrollView.scrollEnabled to NO in order to see the swiping return.

How to customize button in UITableViewCell?

I have implementing listing page in UITableView.Now i am flicking finger on to the table cell then delete button appear but i want to my custom image insted of delete.Is it possible please give me advise?
You can try to create your own button and add it to your cell as a subView.
There isn't a built in way to change that button, it's part of the standard UI. You could, however, catch the flick yourself, and create your own button that says whatever you want.
I think it might be possible to grab the deleteButton reference and alter it, but that would affect the whole application and isn't a good practice to get into.