I've gotten a little confused for how I should implement below,
I need to scroll between UIViews or UIViewControllers each one having different set of data do display. For example, 1st view has a UITableView, other only has a button, 3rd may again have a UITableView.
Should I be using UIPageViewController and load different UIViewControllers for each content OR use UIScrollView with contentSize = number of pages.
In my current implementation. I have used UIScrollView which scrolls between different UIViews and loads their content. But, the problem is when I tap on the UITableView in one of the views, tap events are not captured by UITableView, but UIScrollView captures the touch events.
I did try bringing my UITableView to front with,
myTable.becomeFirstResponder()
scrollView.bringSubviewToFront(myTable)
scrollView.delaysContentTouches = false
scrollView.canCancelContentTouches = false
I added a UITapGestureRecognizer on UITableView but it does not receive tap events. UIScrollView receives a tap event if I add UITapGestureRecognizer on it.
My current view heirarchy is,
UIScrollView -->
UIView -->
UITableView
UIView -->
UIButton and other subViews
UIView -->
UITableView
NOTE : I want this scroll view or paging view only as a portion of my main View Controller. (half of my main view)
Please guide me through this.
I found the solution myself,
I just had to remove the UIView from the hierarchy where a UITableView was required. So now my view hierarchy becomes,
UIScrollView -->
UITableView -->
UIView -->
UIButton and other subViews
UITableView -->
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With