有没有办法检测我的应用运行的设备是否支持UIMotionEffect
?
答案 0 :(得分:1)
你可以这样测试:
if ([UIMotionEffect class]) {
// do stuff with UIMotionEffect
} else {
// UIMotionEffect does not exists
}
在iOS< 4.2这样做:
Class theClass = NSClassFromString(@"UIMotionEffect");
if (theClass) {
// do stuff with UIMotionEffect
} else {
// UIMotionEffect does not exists
}