24 Sheets

Sheets are a common interface pattern in OS X for situations where you need to collect input from the user and you want to associate that input with a particular window. A common example of a sheet is the document save panel. Sheets are windows that are presented from another window. The sheet comes down over the window, blocking user input to the presenting window until it is dismissed. Typically, you will create a new window controller for each sheet.

NSWindow has several methods used to present and dismiss sheets. You call these methods on the window that is presenting the sheet. The sheet window itself is specified as a parameter.

f​u​n​c​ ​b​e​g​i​n​S​h​e​e​t​(​s​h​e​e​t​W​i​n​d​o​w​:​ ​N​S​W​i​n​d​o​w​,​ ...

Get Cocoa Programming for OS X: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.