Instance Method

enterFullScreenMode:withOptions:

Sets the view to full screen mode.

Declaration

- (BOOL)enterFullScreenMode:(NSScreen *)screen withOptions:(NSDictionary<NSViewFullScreenModeOptionKey, id> *)options;

Parameters

screen

The screen the view should cover.

options

A dictionary of options for the mode. For possible keys, see Full Screen Mode Options.

Return Value

YES if the view was able to enter full screen mode, otherwise NO.

Discussion

When the NSFullScreenModeApplicationPresentationOptions is contained in the options dictionary, the presentation options that were in effect when this method is invoked are not altered, and no displays are captured.

If you do not wish to capture the screen when going to full screen mode, you can add NSFullScreenModeApplicationPresentationOptions to the options dictionary with the value returned by the presentationOptions.

When the NSFullScreenModeApplicationPresentationOptions options is specified, exiting full screen mode using exitFullScreenModeWithOptions: will restore the previously active presentationOptions.

Special Considerations

In OS X v 10.5, invoking this method when the view was not in a window would cause an exception. In macOS 10.6 and later, you can now send this message to a view not in a window. For applications that must also run in OS X v 10.5, a simple workaround is to place the view in an offscreen dummy window.

See Also

Fullscreen Mode

- exitFullScreenModeWithOptions:

Instructs the view to exit full screen mode.

inFullScreenMode

A Boolean value indicating whether the view is in full screen mode.

NSViewFullScreenModeOptionKey

These constants are keys that you can use in the options dictionary in enterFullScreenMode:withOptions: and exitFullScreenModeWithOptions:.