iOS Accessibility fail to focus next tableviewcell - ios

I have tableview with these tableview cells:
- cell have some collectionview and cell have Height larger than haft of screen
- cell have other tableview inside it
When access to the last item inside cell (collection cell or tableview cell inside), i swipe right to focus on next cell. But it not jump to next cell in tableview, It jump to other item on screen
Example: i have main tableview, in this table have some cell is expanded cell which have other small tableview inside it. When this cell was expanded and i swipe right to last item of small tableview, then i swipe right again to move to next cell of main tableview view. But this time the next cell of main tableview was not focused, but some other item in screen gets focus
Could you give me the hit! Thanks a lot.

Related

iOS UITableView - once sorted, a cell is scrolled on top of a Header

I use the next code to change position of a cell:
self.tableView.moveRow(at: moveFromIndex, to: moveToIndex)
Once the cell is moved, it starts scrolling on top of a header
What could the reason?

How to change layout of a UITableViewCell with a UIStackView

I have a custom UITableViewCell with a vertical UIStackView. The stack view in-turn has 2 UILabels, one of it is hidden by default. How to change the height of the cell to show both labels in the stack view properly when the second label is unhidden. On a button click when i show the second label, it tries to show both label with the same height overlapping each other, however when i scroll the view up and down, it re-renders it ok.
I tried to call SizeToFit and LayoutIfNeeded with no help. How do i change the height of the row/cell to show both labels in the stackview to look proper?
You can call
tableView.beginUpdates()
tableVIew.endUpdates()
After tap on button, and your cell change height. It solution is compatible with animation.
On the button click, the label 2nd is showed, you should reload the table view, or reload exactly the cell, the height of cell will change and the cell will be re-rendered
Try reloading that row with reloadRows(at indexPaths: [IndexPath], with animation: UITableView.RowAnimation) after you click the button that shows both labels.

How to solve TablviewCell Content Overlapping Issue

In tableview I have customcell reusable cell which overlap content of privious cell or last cell content overlap with first cell when scroll Tableview
You should set properties that depend on indexPath in viewForCell function, always.

How to add view beside tableviewcell with Swift?

I'd like to add view beside tableviewcell when user click table view cell.
before user click
---cell1---
---cell2---
after user clicked
---cell1---
---detailview---
---cell2---
How to do that?
If you are looking for something like another view appearing below the tapped cell and not an expanding tapped cell,you can insert a tableview cell just after the tapped cell.Use insertRowsAtIndexPaths and insert the cell.You can create this cell as a custom cell.
There is 2 options to do that:
- To make detailView as another cell, just insert below the cell user clicks
- Cell add the detailView initially. And make a switch to show it or hide it.Just because cell in table view is reused, we should not add subview in a cell already in table view, which will cause some problem in reusing.

How to get middle cell of horizontal table view in ios?

I have rotated my table view by 90°. Now I want to get indexpath of middle cell. When table view is not scrolling, it is showing 3 cells. What I want is, when table view stops scrolling, it should middle cell of green color. Sometimes I get wrong indexpath when more then 3 cells are visible while fast scrolling.
I have attached image for reference
try this
NSIndexPath *middleIndexPath = [tableView indexPathForRowAtPoint:CGPointMake(tableView.center.y, tableView.center.x)];
UITableViewCell *middleCell = [tableView cellForRowAtIndexPath:middleIndexPath];
You can get contentOffset of table view. With contentOffset, you can calculate current row (contentOffset.y / row height)

Resources