How does the twitter iOS app achieve the paged swipable timeline? Is it simply 3 UITableView's nested in a paged scrollview or using custom view controller transitions?
I tried the nested UITableView approach, but when you scroll down, the content doesn't move under the navigation bar like the twitter app does. Since its the nested UITableView scrolling and not the parent scrollview.
I've recently done a very similar behavior using a UIPageViewController
and UITableViewController
's for the content. That's very easy and straight forward to implement. For the dots in the NavigationBar you could just add a custom titleView which holds a UIPageControl
To give an example:
You need a UIPageViewController
that implements the UIPageViewControllerDataSource
protocol. The dataSource asks for the methods:
- (UIViewController *)pageViewController:(UIPageViewController *)pageViewController
viewControllerBeforeViewController:(UIViewController *)viewController;
and
- (UIViewController *)pageViewController:
(UIPageViewController *)pageViewController
viewControllerAfterViewController:(UIViewController *)viewController;
where you just need to return the UITableViewController
instances which present your content.
The swiping etc. is a default behavior of UIPageViewController
For a more detailed example have a look at this tutorial which helped me a lot.