ReadMe.txt

Gradients
 
This simple application demonstrates use of the CAGradientLayer class, simple implicit animations, and using the CATransaction class to control the length of implicit animations. A single gradient layer is displayed and continuously animated using new random colors. The gradient layer is also scaled to match the window, if resized.
 
GradientsAppDelegate.h/m
Standard app delegate generated by Xcode for a new project.
 
AppController.h/m
This is the main controller for the application and handles the setup of the layer objects, connecting them up to the view, and animating and scaling the gradient layer. An instance of this class resides in MainMenu.xib and uses an IBOutlet reference for the view (which has been wired up through Interface Builder).
 
-awakeFromNib:
This method will be called when the AppController instance is 'defrosted' from the nib and will setup the layer hierarchy and start the timer to continuously animate the gradient layer.
 
-animate:
Animates the gradient layer to two new random color values. This will be repeatedly called by the animation timer.
 
-(void)windowDidResize:(NSNotification*)aNotification
Called when the window is resized and will scale the gradient layer to fit the new size. This is a delegate method of NSWindow and will sent to the AppController because it has been wired up to the delegate outlet on the window in Interface Builder.
 
float randFloat()
Auxiliary function used to generate a pseudorandom floating point value in [0, 1]