Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create UIViewController xib file for my existing ViewController file in Xcode 8

I have an existing View Controller file with a set of code. I want to create an interface builder file for the ViewController and link them. Right now i don't seem to find UIViewController option in the New file options as give here. enter image description here

Can any body tell me how to achieve this?

like image 796
Praveen Kumar Avatar asked Oct 07 '16 12:10

Praveen Kumar


1 Answers

Now Apple preferably recommend to use storyboard as its easy to use and handle view controllers but still if you want to create separate view controller Please follow these steps.

1- Create objective c file or swift as you like
2- Change the UIView class to UIViewController
3- Create xib file
4- Add UIViewController object as shown in pic
5- Select the controller go to the 'Show inspector identity' and set the controller custom class

like image 145
salman khalid Avatar answered Oct 01 '22 03:10

salman khalid