Reputation: 23
I've created one UIScrollView with multiple (10) UITableViews to show content. The UIScrollView allows the user to horizontally scroll to show the different UITableViews. This is a specific use case in this app which we want to implement this way.
The UITableViews all represent one week in the total of ten weeks. What I want to do is after the scrollview scrolled to another UITableView (week) the Navigation bar title changes to "Week x". The UIScrollView has paging enabled and works like a charm.
The question however is how do I keep track of the pages changing? I cannot seem to implement a SwipeRecognizer, Touches began or the ScrollViewDidScroll. Is there a way around this?
I think I have the same question as this guy, but no satisfying answer so far: How to find which table is scrolled with multiple UITableViews on UIScrollView
Upvotes: 1
Views: 767
Reputation: 1479
You should implement the UIScrollView delegate method scrollViewDidScroll:
and check the content offset.
For example, When the content offset x value is 0, then you're viewing the first table view. When it's 320 you're watching the second table view and so on.
320 is just an example value. You should change this to be the width of the UIScrollView.
Upvotes: 1