Currently, I have a UIView subclass that \"stamps\" a single 2px by 2px CGLayerRef across the screen, up to 160 x 240 times.
I currently animate this by moving the UIVie
What CALayer methods are you seeing that don't work on iPhone?
As one example, I tried implementing the grid demo here, without much luck. It looks like CAConstraintLayoutManager
and CAConstraint
are not available in QuartzCore.h
.
In another attempt, I tried a very simple, small 20x20 CALayer
object as a sublayer of my UIView
's layer property, but that didn't show up.
Right now, I have a custom UIView
of which I override the drawRect
method. In drawRect
I grab a context and render two types of CGLayerRef
s:
At "off" cells I draw the background color across the entire 320x480 canvas.
At "on" cells, I either draw a single CGLayerRef
across a grid of 320x480 pixels (initialization) or across a 320x2 row (animation).
During animation, I make a UIImageView
clip view from 320x478 pixels, and draw a single row. This "pushes" my bitmap up the screen two pixels at a time.
Basically, I'd like to test whether or not using CALayer
will accomplish two things:
CALayer
has less overhead than what I'm doing nowUnfortunately, I can't seem to get a basic CALayer working at the moment, and haven't found a good chunk of sample code to look at and play with.