This question already has an answer here:<ul><li> <a href="/questions/15725016/how-to-load-multiple-storyboard-files-depending-on-ios-version-5-and-6" dir="ltr" rel="nofollow">How to load multiple storyboard files depending on iOS version? (5 and 6)</a> <span class="question-originals-answer-count"> 1 answer </span> </li> </ul>
I'd like to optimize my app on iOs7 but this is really hard. Xcode looks pretty buggy...
Do you know if it is possible to have 2 storyboards, one for iOs7 and the other for older versions ?
Thanks a lot !Answer1:
Here's what you need to do. Put this type of logic in your
applicationDidFinishLaunchingWithOptions: method of your app delegate:
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) #define iOS_7_OR_LATER SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7") UIStoryboard *storyboard = [UIStoryboard storyboardWithName:iOS_7_OR_LATER ? @"Storyboard-iOS7" : @"MainStoryboard" bundle:nil]; self.window.rootViewController = [storyboard instantiateInitialViewController]; [self.window makeKeyAndVisible];