UIKit Custom UIView with XIB: How to improve your productivity by 10 times with Custom Views
2 min readMay 13, 2022
It is no exaggeration to say that the history of software development was written by reusability. Almost all development tasks end up being one. ‘Reusability’. So, today, I am going to introduce how to create a custom view using xib.
[1] Create Custom View with xib
[2] Create Cocoa Touch Class, UIView
[3] Connect your xib file with cocoa touch class by specifying its name on the right panel.
Many other tutorials would tell you to set FileOwner. But no need for taht!
[4] Apply Freeform
It’s not necessary. But assuming that you are create a view instead of the entire screen, choosing Freeform will be much more helpful.
[5] Design your component!
[6] Load Nib
[7] Check!
Conclusion
- Create xib File
- Create CocoaTouch Class UIView
- Connect your xib File with CocoaTouch class through Custom Class
- Load Nib Programmatically