I want to make a universal app. Although I know how to make it, generally we do it by making separate XIBs for iPhone and iPad. But I do not want to make it by using two xibs, or by just hard coding the frame for different devices. Can anyone help me with some code or any sample app links so that a single piece of code should work for all the devices? I also do not want to compromise the associated device resolution.
Asked
Active
Viewed 83 times
0
-
If you're using auto layout then UIKit will attempt to format your views for the screen size and you can simply use the same file for all devices, however you cant specify different layouts depending on devices within the same xib file, so you may find it inflexible at times. – axiixc Nov 18 '13 at 07:50
-
Thanks, but I we are misunderstanding some thing. I want to make view through programing and in programing what should I do so that I need not to adjust the frame for different devices. Like I do not want to give separate frames for iphone, iphone5 and ipad. If we do so that in future if another device of different resolutions comes then our view will get fail in that case. – user2999125 Nov 18 '13 at 09:07
1 Answers
0
You should use two different xibs for iPad and iPhone. just append ~ipad or ~iphone at the end of your xib name like ViewController~ipad.xib
so it load according to the platform.

Nicolas Manzini
- 8,379
- 6
- 63
- 81