All pastes #815238 Raw Edit

Someone

public text v1 · immutable
·published 2007-12-13 22:15 UTC
rendered paste body
What’s Going On
When the application instantiates, its applicationDidFinishLaunching method is called by the run-time. 
This method initializes a new window and sub-class of the UIScroller view named CFView, into an object named mainView. Various properties of the scroller are set to define the behavior of the scrolling view.
Each album cover is loaded into a UIImage object and then the layer which backs this view is added as a sublayer to a container LKScrollLayer call cfIntLayer. For the purposes of this example, the default wallpaper is loaded for each album cover’s graphic. When the application has finished initializing, the layoutLayer method is called.
The layoutLayer method positions every layer in the view to be oriented according to its position. The selected album is brought to the front, while others are rotated using the rightTransform and leftTransform LKTransform objects. The container layer, cfIntLayer, is then scrolled to the midpoint of the selected cover layer, and itself re-positioned in the center of it's parent ScrollView.
When the user drags their finger, the mouseDragged method is called. This causes a new cover to be selected and calls layoutLayers to be called again.
An LKTransaction is created to ensure that all objects are animated at the same time. The newly selected album is oriented to the front of the screen. When the transaction is committed, the Layer Kit framework performs all of the tweening automatically to occur over the specific duration for the animation (0.03s).