I have a project in Xcode 8 in which I am using one view controller when i try to add another view controller i get a viewcontroller.h which i cannot edit or unlock. Why is this happening? Can I use more than one View Controller in a project? If you know how to create another View Controller please answer.
Thank you in advance
You can have as many viewcontrollers in project as long as you name them uniquely. Follow the steps: 1) Right click on folder in which you want to create a viewcontroller 2) Select New File option 3) In the "Choose a template for your view file" select source in ios & click on "cocoa touch class" --> tap Next 4)In next window Enter "Class" which will be name of your new view controller & in "Subclass of" make sure you select "UIViewController" class. Select "Language" as Objective-c & then click Next 5) In next window click "create" button
That is all you have to do.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With