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.
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.
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:
Right click then drag to View.
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
-> ClickAlso create XIB file