Question

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?

enter image description here enter image description here 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.

Original Source link of images

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top