Monday, January 3, 2011

SDK Compatibility Guide

Method 1
if ([UIImagePickerController instancesRespondToSelector:
@selector (availableCaptureModesForCameraDevice:)]) {
// Method is available for use.
// Your code can check if video capture is available and,
// if it is, offer that option.
} else {
// Method is not available.
// Alternate code to use only still image capture.
}

Method 2
if (CGColorCreateGenericCMYK != NULL) {
CGColorCreateGenericCMYK (0.1,0.5.0.0,1.0,0.1);
} else {
// Function is not available.
// Alternate code to create a color object with earlier technology
}

Method 3
if ([UIPrintInteractionController class]) {
// Create an instance of the class and use it.
} else {
// Alternate code path to follow when the
// class is not available.
}

No comments: