I want to create UIView commonly. And use that view in all the view controllers. How can create the UIView sub class with xib and use in all the view controllers? Thanks in advance.
- You need to create your subclass:
File -> New -> File -> Cocoa Touch -> Objective C-class -> Subclass of Target Class Type(UIView on your case)
- Then, you create the
File > New > User Interface > View(name your xib)
- Now go and design your
- Last thing you should do is to change your view's Class Type in
Identity Inspector. Your custom xib will be linked with your custom class.
Let me know if you need further detail.