适用于iOs 7的特定StoryBoard [英] A specific StoryBoard for iOs 7

查看:114
本文介绍了适用于iOs 7的特定StoryBoard的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在iOs7上优化我的应用,但这真的很难。
Xcode看起来很漂亮......

I'd like to optimize my app on iOs7 but this is really hard. Xcode looks pretty buggy...

你知道是否可以有2个故事板,一个用于iOs7,另一个用于旧版本?

Do you know if it is possible to have 2 storyboards, one for iOs7 and the other for older versions ?

非常感谢!

推荐答案

这是你需要做的。将此类逻辑放在您的应用代理的 applicationDidFinishLaunchingWithOptions:方法中:

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];

这篇关于适用于iOs 7的特定StoryBoard的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆