dctroy
dctroy

Reputation: 51

How can I manage and transition between a grid of UIViewControllers?

Let's say I have a grid of UIViewControllers, arranged in two rows of 4 each.

I'm using iOS 7 and want to setup custom transitions between them; a user could go up and down between the rows, or left and right between them in a single row.

What's the best way to set up and manage this? I know how to do the transitions to indicate the left-right and up-down motion through the application space, but I'm not sure the best way to manage the overall structure of the UIViewController grid.

I thought at first I'd use UINavigationController, but I specifically do not want the push/pop model; I just want each UIViewController to have top, bottom, left, and right neighbors and navigate between them.

And I don't mind instantiating them each time, if that's the right way to do it; it just seems a bit clunky, like it might be better to have some object that keeps track of the grid and manages the links between them -- like UINavigationController, but a matrix, rather than a stack.

Any feedback or advice appreciated! Thanks much

Upvotes: 1

Views: 69

Answers (1)

Jordan Smith
Jordan Smith

Reputation: 10378

See this example. You could use this code or alter it to suit your needs:

https://github.com/MarcoSero/MSMatrixController

Upvotes: 2

Related Questions