Use storyboards in a project which has .xib files- iPhone

后端 未结 3 687
庸人自扰
庸人自扰 2020-12-08 16:00

I want to use generally the old .xib files in my iPhone application. But when it comes to tableViewController storyboard is a lot more convenient in order to make custom cel

3条回答
  •  离开以前
    2020-12-08 16:55

    You can use a storyboard for any part of a program. Storyboards are not an all or nothing concept. You can have just one view controller in a storyboard, or a small network that just represents a subsection of your app.

    To use just one view controller from a storyboard:

    1. Add a new storyboard to your existing project.
    2. Add a single view controller to the storyboard.
    3. Assign an identifier to the view controller in the inspector.
    4. Use the UIStoryboard class to load the storyboard resource
    5. Use -[UIStoryboard instantiateViewControllerWithIdentifier:] to create a new instance of that view controller.
    6. Install the view controller some place in your app by doing something like pushing it on to a navigation controller, or run it modally.

提交回复
热议问题