Summary
Subclassing NSView to handle events and manage the cursor enables the creation of complex views that accept user input. Application Kit classes such as NSControl, NSScrollView, and NSSplitView extend NSView using the techniques described in this chapter to provide the standard behaviors of Cocoa applications. After using Cocoa for a while, programmers can often guess exactly how the various Application Kit subclasses of NSView are implemented. The important realization is that there is no magic involved.
Views provide one of the most common ways to accept input from users. Another common way users interact with programs is via menus. Chapter 16, “Menus,” delves into menu management, including the interaction of menu items and the responder ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access