2015-04-28 117 views

回答

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 
}