Is it wise to “nest” UIViewControllers inside other UIViewControllers like you would UIViews?

后端 未结 3 1643
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-05 00:31

I\'ve got a fairly complex view, for me anyway, that has a few \"trays\" with custom interface items on them. They slide in and out of my root view. I\'d like to nest (addSu

3条回答
  •  失恋的感觉
    2020-12-05 01:08

    My experience on what you are trying to do has been a good one. I try to keep nib files as simple as possible, so I take any posible "subview" and encapsulate it in its own nib file with it's own view controller, therefore I end up having nested view controllers. In one of my apps I have a very complex table view cell, that has a subview. So I ended up having a hierarchy that goes like this: the tableview controller on the top level, the tableviewcell's controllers for each row and inside each of these a subviewcontroller for the subview inside each cell.

    And everything works fine.

    Pardon my english.

提交回复
热议问题