如何检测UIMotionEffect是否受支持?
答
你可以这样测试:
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
}