1
有沒有辦法來檢測我的應用程序運行在設備上是否支持UIMotionEffect
?如何檢測UIMotionEffect是否受支持?
有沒有辦法來檢測我的應用程序運行在設備上是否支持UIMotionEffect
?如何檢測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
}