I just started using ios 6 autolayouts and I have to say I like them quite a bit. That said, I’m working on an app which needs to support both ios 5 and the iphone 5. Unfortunately, it seems that I can’t use autolayout if I want to support ios 5. As such, I’m wondering what the best way is to support ios 5 while not having your layouts look bad on the iphone 5?
I can see a few possible solutions, but they all seem pretty awful.
I could do some kind of macro where I pass two nib files and it picks one depending on the operating system?
I could do multiple build targets with different nib files loaded in them depending on the operating system.
I could replace autolayout constraints with autoresizing masks all over the whole app.
Does anyone have any experience with this problem they could share?
First idea to load different nibs is better, if you want to leave your autolayouts. However, you should use not macro, but simple check in your code since macro check wouldn’t work as it is performed only ONCE when you compile your project.
On the other side, it is recommended to use autoresizing masks if you are supporting old iOS versions