Search code examples
iphonecuiimagecalayercgimageref

Does UIView .layer CALayer begin with a layer?


For a little project to become a more optimized efficient programmer for the upcoming iPhone game I'm making, I'm trying to make a user interactive interface, but it's difficult.

In my last question posted yesterday I asked about improving my ability to modify events of a UIImageView, and UIView to accept touches, (and it's working quite well!)

Though, the nice fellow then answered with even more helpful advice, UIView contains a .layers which contains CALayer, in which I'm trying to access the CALayer .contents to try to see if I can add an image manually to UIView using CGImageRef. I'm having difficulty in xcode for it to even recognize the layer properties.

So, I've come to a quite uninformed uneducated conclusion (hypothesis/guess/what-have-you) that if doesn't begin with a layer! But at the same time, that can't be the case, otherwise UIView wouldn't be able to handle a background color. Some help would be much appreciated!


Solution

  • I'm having difficulty in xcode for it to even recognize the layer properties.

    Make sure you #import <QuartzCore/QuartzCore.h>.