You’re previewing Ry’s Cocoa TutorialUI Components

Scroll Views

When you have an NSView instance that is too big to be displayed in full, you can embed it in a Scroll View component to provide automatic scrolling support. This is the third and final container view that we’ll be discussing in the UI component reference. Its underlying class is NSScrollView.

Scrolling a large view with a Scroll View component

Scroll Views are an integral part of many built-in UI components, and it’s actually more common to use them in conjunction with Table Views, Outline Views, and Collection Views.

Standalone Scroll Views typically contain a single large view, like an image or a graphical editor’s canvas area. In general, you should avoid embedding complex user interfaces like long forms in an NSScrollView, opting instead to break up the content with a Tab View.

In this chapter, we’ll learn the basic structure of a Scroll View. This knowledge will not only enable us to scroll large amounts of content, but also give us more control over the other UI components that rely on NSScrollView.

Sorry, this is the end of the preview. To read the rest of this chapter, you’ll need to purchase Ry’s Cocoa Tutorial.

Mailing List

Sign up for my low-volume mailing list to find out when new content is released. Next up is a comprehensive Swift tutorial planned for late January.

You’ll only receive emails when new tutorials are released, and your contact information will never be shared with third parties. Click here to unsubscribe.