Thanks
Thanks

Reputation: 40329

Is it a good idea to nest several view controllers to achieve complex interfaces with iPhone OS?

I wonder if that hurts performance. I have an test app which is pretty huge regarding view controllers. Rather than changing just from view A to B, I slide everything around. So I have a root ViewController, which is used for the basic application feature areas. It instantiates other view controllers on demand, puts them into UIView containers and slides them around to make nice effects. Those view controllers are considered as root controllers theirselves, and each of them creates another set of view controllers for different stuff.

So at the end I have a hierarchy consisting of about 15 views. Everything is smooth, but it feels a little bit strange. Well I guess it's normal. Just wanna know what you think / do. Am I crazy?

Upvotes: 0

Views: 112

Answers (1)

Emiel
Emiel

Reputation: 1502

This seems like a fine way of doing things. In fact, the user interface toolkit apple supplies works the same way internally. A button, or any other visual element is in itself a view, with its own view controller. By just adding buttons to the screen you are already nesting views and controllers.

Upvotes: 1

Related Questions