How do I use xib to customize the view and use it on the controller's xib file

How do I use xib to customize the view and use it on the controller's xib file

I didn't find the result I want on the Internet

Does Xcode support this

Please tell me how to achieve it

Thanks a lot

Replies

Your question is a bit vague and large.


But I'll try to help.


The best in SCode is to use storyboards ; you will have all the UI elements inside the different controllers and you connect them to IBOutlets and IBActions in your code.

You add the objects by selecting them in the object library.

Does that make sens for you (I don't know what is your level of knowledge).


In some cases you may need to define a custom view ;: for instance to create cell prototypes for tableViews.

Then you do this also in XCode:

- create a new file

- select what you want to create; in your case, an IOS Cocoa Touch class

- select the base class (may be UIView, ViewController, UITableViewCell…)

- give the subclass a name (select with some thought, at it will used in the code)

- select the "Create xib" checkbox


You then end up with 2 files, one xib and one for code, already connected by Code.


It is now up to you to populate them. But tha's another story.


Good luck.

Should be supported, at least in general - is there an issue with an error that you're seeing?

Look at this: https://www.youtube.com/watch?v=H-55qZYc9qI&t=303s