Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How To: Simple UIViewController w/ .xib using XCode15

I’m having issues creating a simple UIViewController in XCode15.

I want to create a .xib and accompanying .swift file as a controller.

Things seemed to have changed and I can’t create a UIViewController with .xib.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I’m facing some error where it says the view outlet is not set.

I’ve tried everything.

Is there something wrong within the didSelectRowAt method?

Below are some screenshots of the latest attempt.

Any help (even step by step from scratch) would be much appreciated.

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

>Solution :

You have it configured incorrectly. Actually, CustomVC.swift should be assigned to File's Owner. Then set the View as a referencing outlet for the File’s Owner. You’re assigning a UIView (which is CustomVC on xib file) to an instance of UIViewController.

Those steps are:

enter image description here

enter image description here

Right click then drag to View.

enter image description here

Note: I don’t know why you’re starting from scratch, but here’s an alternative:

XCode -> Command + N to create new file -> on iOS tab select Cocoa Touch Class -> Click Also create XIB file

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading