Swipe to Delete Section Header in UITableView - ios

I am working on extended data and a UITableView. I am able to use swipe to edit and delete functions. I am wondering if it is possible to swipe and delete only section headers. If yes, how?

I am not sure what you want to achieve.
But if you want to have a swipe delete for a section header, the answer is, you can do it, but it requires some kind of programming. Essentially, you had to add a „section header delete button“ as a subview to the table views content view.
I suggest reading Ray Wenderlichs tutorial „How To Make A Swipeable Table View Cell With Actions – Without Going Nuts With Scroll Views“. This demonstrates how you can add swipe gestures to a table view cell.
However the same techniques (e.g. controlling the position within the scroll view) can be applied to a section views header.

Related

Swipe to delete tableview section [duplicate]

I am working on extended data and a UITableView. I am able to use swipe to edit and delete functions. I am wondering if it is possible to swipe and delete only section headers. If yes, how?
I am not sure what you want to achieve.
But if you want to have a swipe delete for a section header, the answer is, you can do it, but it requires some kind of programming. Essentially, you had to add a „section header delete button“ as a subview to the table views content view.
I suggest reading Ray Wenderlichs tutorial „How To Make A Swipeable Table View Cell With Actions – Without Going Nuts With Scroll Views“. This demonstrates how you can add swipe gestures to a table view cell.
However the same techniques (e.g. controlling the position within the scroll view) can be applied to a section views header.

UITableView inside of UIScrollView or using TableView Header

I guess this question is more of a best practice question than a problem solving question.
I would like to have a page on my app that has a UITableView at the bottom of it and some buttons/text above the UITableView but instead of just the UITableView scrolling, I would like the whole page to scroll.
I have been searching around and some people say to put the UITableView inside of a UIScrollView and disable scrolling on it and recalculate the height so the table view is as tall as all of it's rows.
Then I have read some other people say just to put the buttons/text in a Table Row Header and just have that scroll with the whole table view.
Which is the better practice and are either of them frowned upon?
Thanks!
Open the main storyboard and on the bottom right hand side you should see a list of view controllers, buttons, gestures etc.. In that list there should be a controller called "page control" that opts for the page-scroll you are looking for as well as the continuous one which you are trying to get rid of, you can just insertt this in to your basic view controller (via drag and drop). As for the button responsible for the segue (turning the page) you can find that in the list too. I can't explain how to program the button to turn the page step by step as I am typing this on my phone at work right now. If you want I can edit this later in more detail

Drag to Delete - UICollectionView

So we've all probably seen Facebook's method of removing messenger chat heads from the view, I want to implement a similar method of deletion, however to collection view cells within a collection view. When there is a long press on a cell, a box would appear at the bottom of the view and the user would be able to drag the cell to the box for deletion, or simply let go of the select cell and thus returning to it original position and state.
I am aware of two libraries that allow collection view cells to be dragged around and reordered and was going to attempt to use those to implement such a feature, however they allow complete reordering of cells within a collection view and I figured there may be an existing library for implementing my desired feature, or a simpler method.
So basically my question is, what's the best method of implementing this feature into a collection view and if you are aware of a library that allows this easily, it'd be great if you could share it.
Code examples are always welcome and make things a lot easier.
Collection view cell re-ordering libraries: LXReorderableCollectionViewFlowLayout and DraggableCollectionView
I understand how to go about deleting the collection view cells, i'm more interested in the method of deletion. *

UICollectionView Section Headers as Accessibility Headers

I have two questions regarding accessibility and UICollectionViews that I'm hoping to get some expert help with. The other question, regarding Voice Over read order, is here. I've created a sample project demonstrating both issues.
I have a UICollectionView where I'm providing custom section headers. These section headers are accessibility elements and have the accessibility trait UIAccessibilityTraitHeader set. When Voice Over is enabled, and the user is swiping horizontally through the collection, the header is announced properly, and it is even declared as a header. However, if the user swipes up or down to the next header, Voice Over will only jump to another header if it is visible. I'm assuming this is because when a view isn't visible in a collection view, it's removed from the view hierarchy and Voice Over no longer knows it exists.
You can pull this example project, run it, enable voice over, and use the dial to set the swipe up/down to headings to view the issue.
Is there a way I can allow the user to jump to a header that is not currently visible? Any help would be greatly appreciated.
You might have to use the scrollToItemAtIndexPath:atScrollPosition:animated: property of the UICollectionView to scroll the header into view before VoiceOver can read it.
You can find out which indexPath you are currently at via indexPathForItemAtPoint: using the position of where they touched within the collection view and then you know which section comes after.

How move/reorder cells from TableView1 to TableView2

I have several UITableViews, with different datasources in a iPad screen.
I need to copy/move a cell from the first tableView to the second, similar how is done with ListBox in other languages.
Now, I can reorder the cells, but the movement is restricted to the tableView. I want to drag the cell in tableView1 & drop in tableView2.
P.D. I'm open to use any other control to archive this. I take a look at AQGridView & DTGridView, however the layout is based in columns with different #items. If I can emulate columns with this controls or other then I can accept the workaround.
UPDATE:
I hope this links could help:
Observing pinch multi-touch gestures in a UITableView
This is the most close answer:
Drag and drop between two tables in ipad
I know how get a image from a view, I can detect the drag with a Gesture Recognizers, so I have all the setup in place but have not expertise in graphic development, so don't know how put this in motion...
This is definitely a very interesting question, and I wish I had the time to put together some test code to see if the idea I'm about to outline would actually work. My hope is that this will at least point you in the right direction.
UITableViewCell is a subclass of UIView, so I would create a subclass of UITableViewCell called something like DraggableTableViewCell so we can handle the touch events and then perform the following steps:
Create an instance of DraggableTableViewCell and configure it to appear like the selected cell.
Add the new cell as a subview of a view that is a common superview to both tables at the same location as the original cell.
Update the data source for the source table view and remove the original cell from the table view using deleteRowsAtIndexPaths:withRowAnimation:
Move the cell on the display by responding to touchesMoved:withEvent:
When touchesEnded:withEvent: is received, verify the cell is somewhat close to the other table view and determine the index path where to insert the new cell
Update the data source for the destination table view and call insertRowsAtIndexPaths:withRowAnimation:
Remove your draggable cell from its superview with a nice animation.
This entire process will need to be orchestrated by the view controller that controls the various table views on the screen.

Resources