View Full Version : Is #import <CoreGraphics/CoreGraphics.h> No Longer Required?

Dec 5, 2009, 05:04 PM
i've noticed since the early versions of iPhone SDK that the Core Graphics framework is automatically linked to new projects along with UIKit and Foundation.

just now i've realized that one of my classes which uses Core Graphics will still function (in the simulator, haven't tried on device) even without #import <CoreGraphics/CoreGraphics.h>.

//stuff like this

CGImageRef imageRef = [image CGImage];
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
NSUInteger imageRefHeight = CGImageGetHeight(imageRef);

shouldn't the compiler be freaking out?

Dec 5, 2009, 05:22 PM
If you follow it back I think you'll find 'UIKit.h', included in your '_Prefix.pch', drags it in for you.