是否有方法可以确定运行iOS TodayExtension的设备的设备类型。我无法在Swift中做到这一点。如何在Swift中获取设备类型TodayExtension
我需要有这样的事情:
-(BOOL)isiPad {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
return YES;
} else {
return NO;
}
}
但是在斯威夫特和一个TodayExtension。
编辑:
let IS_IPAD = (UI_USER_INTERFACE_IDIOM()==UIUserInterfaceIdiomPad);
未在iOS中TodayExtensions工作。
比较http://stackoverflow.com/questions/24831850/how-should-i-replace-these-screen-size-and-device-type-macros-in-swift。 – 2014-09-13 18:14:36
@MartinR UIUserInterfaceIdomPad在TodayExtensions上不工作 – 2014-09-13 20:03:09