Reputation: 7358
pardon me for beginner's question.
Besides the first default ViewController with its companion file ViewController.swift
, I created a 2nd viewcontroller and know how to move to it.
How do I add a companion SecondViewController.swift
for it?
Thanks
Upvotes: 0
Views: 3449
Reputation: 5039
If you are using Xib then
1) Goto file->New->iOS->Source->Cocoa Touch Class
2) Select UIViewController as your Base Class and name your class and also check the checkbox with "also create Xib File" click next and click finish.
Now you have a new ViewController with a file associated with it.
And if you are using storyboards then follow these steps.
1) Drag and drop a viewController from object library
2) repeat step 1 and 2 of first method but this time do not create an Xib file
3) select your newly draged droped ViewController and assign it the new class as follows
Now you have a new ViewController with an associated swift file.
Upvotes: 5