Sunday 15 July 2012

ios - Do I need a ViewController container or a composite view? -


I need to implement an andere control for iOS. By Accordion, I mean this is a UI :

Enter image details here

Let me do this Let's find two basic ways, but I'm not sure which one to choose.

Method # 1: Create a View Controller Container, instead of showing something under the UITabBarController , instead of showing the tabs below, I drag the vertical stack of a button, and When you tap one, opens the corresponding panel and the viewer shows the viewer's view.

Method # 2: Create an overall view, add a bunch of scenes directly to it, and show / hide them as needed.

How do I choose here? Do I want to treat sub-units as controllers vs scenes?

Generally, if I can try to avoid it UIView I do not try to do subclass and instead of UIViewController subcategories can not do anything normally requires a controller (model / visual glue code, user interaction, representative content, information handle, etc. ), So if no custom drawing is required then it is usually UIView on the sub Without it, it is possible to do so.

In your case, I can visualize a reusable UIViewController subclass, which represents the listing entry.

  • Toggle between visible hierarchy in response to user interaction (with / together / panel, extended / panel)
    • without animation)

      and another UIViewController subclass represents the entire list. It has the following responsibilities:

      • To make it into a container VC, override the appropriate methods with UIViewController
      • The child's VC is suitable / / Li>

  • No comments:

    Post a Comment