OverlayView

Last Revision:
Version 1.2, 2013-02-28
Upgraded for OS X 10.8 SDK, updated to adopt current best practices for Objective-C.
(Full Revision History)
Build Requirements:
OS X v10.8 SDK or later
Runtime Requirements:
OS X v10.7 or later

An overlay view is a straightforward subclass of NSView that can draw on top of sibling views by simply being the last subview of the parent. In this example, we imitate a behavior of Interface Builder and Keynote to show "guidelines" between the edge of a view and the edges of the view which contains it. We also use tracking areas to receive mouse moved events and implement some mouse event handling methods to allow the user to move the views.