layerTrackPosition sample code that tracks and prints the position of a CALayer while it is being animated this code is designed for iOS environment for OSX you'll have to replace the CADisplayLink with CVDisplayLink and translate couple of UIKit elements to AppKit.