create nib file

How do I create a nib file. It's not in File->New->File. Can I instead create a playground file and place a view controller in it and reference the view controller from code?

Accepted Reply

I think you got the answer from Quincey in an older post :

h ttps://forums.developer.apple.com/thread/77497

(If you want to create an old-style app that doesn't use any storyboards, then you can choose Application, which gives a combination of Window and MainMenu just like the old days.)


But are you looking for something different ? But why creating a playground in your application ?

If you creat New -> File and select View, you get a xib File, isn't it ?

Replies

I think you got the answer from Quincey in an older post :

h ttps://forums.developer.apple.com/thread/77497

(If you want to create an old-style app that doesn't use any storyboards, then you can choose Application, which gives a combination of Window and MainMenu just like the old days.)


But are you looking for something different ? But why creating a playground in your application ?

If you creat New -> File and select View, you get a xib File, isn't it ?

I'm implementing a UIActivityViewController and UIActivity, which UIActivity requires me to instantiate a view controller. One of the initializers for UIViewController requires a nib file. I didn't realize a nib file and a xib file were the same. I guess xib is the newer version of nib or just a newer name for it. I actually figured out another way to use code to instantiate an instance of UIViewController, and that is to create a storyboard and then to make a reference to it. I use a method of the storyboard object to instantiate the view controller.


In my post I made an error in referring to a storyboard by calling it a playground. I actually meant storyboard.

But in fact, it is possible to include a playground in an App !