2015-04-28 228 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 
}