user5696752
user5696752

Reputation: 1

Linking storyboard view controller to its own viewcontroller.swift in Xcode 7.2

In the new Xcode 7.2 (iOS9), how do I add a viewcontroller.swift file and link it to a manually added view controller in the storyboard?

(This seems to be different than previous versions of Xcode where one would manually add a Cocoa Touch file after dragging a new view controller object in thestoryboard.)

Thank you.

Upvotes: 0

Views: 868

Answers (1)

Caleb
Caleb

Reputation: 5616

It has always been the same for me but here are the steps that I follow.

  1. Right click the file explorer on the left
  2. Click Source->Next->Subclass UIViewController
  3. Drag UIViewController into Interface Builder
  4. Click the yellow circle to focus on the UIViewController
  5. Click the Identity Inspector
  6. Set the Custom Class to the name in your Swift File

Upvotes: 2

Related Questions