I’m trying to develop some reusable ViewController classes.
I usually have a two tableViews in on ViewController in my older viewControllers (pre iOS5).
I’m planning a rewrite and I was thinking about using the new iOS 5 containment APIs,
Consider this example:
Ideally, i would use two viewcontrollers, each ViewController having 2 tableViews. At anypoint either ViewController would essentially show 2 tableViews.
I was wondering if I should:
Use 4 ViewControllers, each having a tableView, add those to a ParentContainerView. Arrange them in my previous order.
The problem would be, to be able to show two ViewControllers at the same time in a divided manner, change the behaviour of A viewController when a sliding gesture is IN PROGRESS.
To reflect sliding gestures:
i really cant seem to figure out how to reflect the swiping gestures down to the child view controllers and influence the sliding behaviour of the viewcontroller. Any example would be great.
Forexample, ViewController at index 0 would reduce in width before disappearing to the left when a right swipe gesture is in progress a new ViewController at index 2 appears, all while the middle ViewController (index 1) changes its yposition and not its width.
ANy suggestions would be great,
I don’t know if this is what you want, but I’ve implemented something like this using a scroll view with four container views in the scroll view’s content view. Each of those container views has an embedded segue to a view controller (would be a tableViewController in your case).
So this is how I did it:
In the view controller, I created IBOutlets to the scroll view (scroller) and to the large (the 640 x 548 one) view (content), and added this code in the .m file:
The 2 gesture recognizers were connected in IB to the moveLeft: and moveRight: methods. So, this gives me the ability to show controllers 1&2, 2&3, or 3&4 on the screen at the same time.