5

I have scrollView. In this scrollView I have another view. In this view I have tableView.

ScrollView>View>TableView

The cells of the tableView are custom and have labels in it.

I need when the label passes thru the center of the scrollView to appear a dimmingView and only the label to be visible.

So I have to use scrollViewDidScroll and inside to add:

let rectOfCell = theTableView!.rectForRow(at: IndexPath(row: 0, section: 0))
let rectOfCellInSuperview = theTableView!.convert(rectOfCell, to: scrollView)

I don't know if this code is going to work, because I don't know how to put the dimming view with only label visible.

After the rect of the label passes thru the middle of the scrollView I need dimming view to appear. How to do that ?

Bogdan Bogdanov
  • 882
  • 11
  • 36
  • 79
  • you are trying something like picker right , just instead only the middle cell will be dimmed ? – Shivam Gaur Aug 01 '19 at 06:57
  • no, everything will be dimmed only the cell will be visible, like example of @Vicaren , but showing the dimming view only when the cell at IndexPath(row:0,section:0) pass the middle of the scrollView. The scrollView is not the scrollView of the tableView. The scrollView is another var – Bogdan Bogdanov Aug 01 '19 at 07:55

0 Answers0