I have a table view with custom cells and each cell contains multiple UI views.
When a user taps on a UI view inside a cell, the app responds to it based on what UI view is tapped. For example, there are three rows and each row has different number of UI views: (These views might be images, labels to compose different layouts)
row1 - view1 view2 view3
row2 - view4 view5
row3 - view6 view7 view8 view9
If a user taps on row3/view8, the app will detect the tap and know view8 is clicked.
Currently I have two directions to implement this:
(1) Add UITapGestureRecognizer
to each UI view
(2) Detect touch on the table view and decide which UI view of visible cells is tapped by calculating which UI view contains the touch point, something like the answer of this question.
I am wondering what the ideal way is? Any other better ways or suggestions?