Can we create xib (with view) programmatically ? If No, why & If yes, How ??
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Xibs are just files, too, so there’s no technical reason why you wouldn’t be able to create one programmatically.
Expect no convenience methods to create xibs however, as their purpose is to circumvent the need to create and configure UI elements programmatically, so what you would like to do is exactly the opposite of what people normally use xibs for.
If you really must create xibs though, just open one in a texteditor – you’ll see that it consists of readable xml code. It may take some time to work through all the keys and possibilities, but creating xibs programmatically can be done.
Edit: it’s gonna be hard, though.