This code works on an iPad 2 simulator, but not on my physical iPad 2 (which is running on iOS 7.0.6):
var fade = CIFilter(name: "CIExposureAdjust", withInputParameters:["inputEV" : -2.0 ])
The full error message says:
[CIFilter filterWithName:withInputParameters:]: unrecognized selector sent to class 0x392d8d9c 2015-07-05 23:12:37.106 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[CIFilter filterWithName:withInputParameters:]: unrecognized selector sent to class 0x392d8d9c'
Check the official documentation of + filterWithName:withInputParameters:
+ filterWithName:withInputParameters:
Availability
Available in iOS 8.0 and later.
Since your iPad is running on iOS 7, this method is not available, and therefore your app crashes.
A few possible solutions:
Use - respondsToSelector:
to check if the method exists.
Check if the current foundation version number, NSFoundationVersionNumber
is higher than NSFoundationVersionNumber_iOS_7_1
.
Make iOS 8 a minimum requirement for your app.