1

Steps:

  1. In an Xcode project add a new Cocoa Touch Class
  2. And select the "Subclass of" UIViewController Select "and also create XIB file"
  3. Then opening the .xib file there is only a UIView.

Any reason there is no UIViewController which would be the logical choice?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Chris G.
  • 23,930
  • 48
  • 177
  • 302
  • 1
    I'm wondering the exact same thing, and even if I add a ViewController to the xib it won't allow me to provide it with a storyboard ID :/ – VDog Oct 10 '17 at 17:52

1 Answers1

0

There is a connection. The connection is that the ViewController you have created is the owner of the xib. This means that you can add outlets and actions to your view controllers.

Also, xib files are just views. A view controller contains a view too by composition.

Ahmed Ebaid
  • 417
  • 6
  • 21