AppKit Functions

This document describes functions and function-like macros defined in the Application Kit framework.

Symbols

Accessibility

Additional information on accessibility can be found in NSAccessibility.

func NSAccessibilityActionDescription(String)

Returns a standard description for an action.

func NSAccessibilityPostNotification(Any, String)

Sends a notification to any observing assistive applications.

func NSAccessibilityPostNotificationWithUserInfo(Any, String, [AnyHashable : Any])

Sends a notification and an optional userInfo dictionary to any observing assistive applications.

func NSAccessibilityRaiseBadArgumentException(Any!, String!, Any!)

Raises an error if the parameter is the wrong type or has an illegal value

Deprecated
func NSAccessibilityRoleDescription(String, String?)

Returns a standard description for a role and subrole.

func NSAccessibilityRoleDescriptionForUIElement(Any)

Returns a standard role description for a user interface element.

func NSAccessibilitySetMayContainProtectedContent(Bool)

Sets whether the app may have protected content.

func NSAccessibilityUnignoredChildren([Any])

Returns a list of unignored accessibility objects, descending the hierarchy if necessary.

func NSAccessibilityUnignoredChildrenForOnlyChild(Any)

Returns a list of unignored accessibility objects, descending the hierarchy if necessary.

func NSAccessibilityUnignoredDescendant(Any)

Returns an unignored accessibility object, descending the hierarchy if necessary.

func NSAccessibilityUnignoredAncestor(Any)

Returns an unignored accessibility object, ascending the hierarchy if necessary.

func NSAccessibilityFrameInView(NSView, NSRect)

Returns the frame in screen coordinates.

func NSAccessibilityPointInView(NSView, NSPoint)

Returns the point in screen coordinates.

Applications

Additional information on NSApplication can be found in NSApplication.

func NSApplicationLoad()

Startup function to call when running Cocoa code from a Carbon application.

func NSApplicationMain(Int32, UnsafeMutablePointer<UnsafePointer<Int8>>!)

Called by the main function to create and run the application.

func NSPerformService(String, NSPasteboard?)

Programmatically invokes a Services menu service.

func NSSetShowsServicesMenuItem(String, Bool)

Specifies whether an item should be included in Services menus.

func NSShowsServicesMenuItem(String)

Specifies whether a Services menu item is currently enabled.

func NSUnregisterServicesProvider(String)

Unregisters a service provider.

func NSUpdateDynamicServices()

Causes the services information for the system to be updated.

Events

func NSEventMaskFromType(NSEventType)

Returns the event mask for the specified type.

Graphics

func NSCopyBits(Int, NSRect, NSPoint)

Copies a bitmap image to the location specified by a destination point.

Deprecated
func NSDisableScreenUpdates()

Disables screen updates.

func NSEnableScreenUpdates()

Enables screen updates

func NSDottedFrameRect(NSRect)

Draws a bordered rectangle.

func NSDrawButton(NSRect, NSRect)

Draws a gray-filled rectangle representing a user-interface button.

func NSDrawDarkBezel(NSRect, NSRect)

Draws a dark gray-filled rectangle with a bezel border.

func NSDrawGrayBezel(NSRect, NSRect)

Draws a gray-filled rectangle with a bezel border.

func NSDrawGroove(NSRect, NSRect)

Draws a gray-filled rectangle with a groove border.

func NSDrawLightBezel(NSRect, NSRect)

Draws a white-filled rectangle with a bezel border.

func NSDrawWhiteBezel(NSRect, NSRect)

Draws a white-filled rectangle with a bezel border.

func NSDrawWindowBackground(NSRect)

Draws the window’s default background pattern into the specified rectangle of the currently focused view.

func NSEraseRect(NSRect)

Erases the specified rect by filling it with white.

func NSFrameRect(NSRect)

Draw a bordered rectangle.

func NSFrameRectWithWidthUsingOperation(NSRect, CGFloat, NSCompositingOperation)

Draw a bordered rectangle using the specified compositing operation.

func NSReadPixel(NSPoint)

Reads the color of the pixel at the specified location.

func NSRectClip(NSRect)

Modifies the current clipping path by intersecting it with the passed rect.

func NSRectClipList(UnsafePointer<NSRect>, Int)

Modifies the current clipping path by intersecting it with the passed rect.

func NSRectFill(NSRect)

Fills the passed rectangle with the current color.

func NSRectFillList(UnsafePointer<NSRect>, Int)

Fills the rectangles in the passed list with the current fill color.

func NSRectFillListWithColors(UnsafePointer<NSRect>, UnsafePointer<NSColor>, Int)

Fills the rectangles in the passed list with the passed list of colors.

func NSRectFillListWithGrays(UnsafePointer<NSRect>, UnsafePointer<CGFloat>, Int)

Fills the rectangles in the passed list with the passed list of grays.

func NSRectFillListUsingOperation(UnsafePointer<NSRect>, Int, NSCompositingOperation)

Fills the rectangles in a list using the current fill color and specified compositing operation.

func NSRectFillListWithColorsUsingOperation(UnsafePointer<NSRect>, UnsafePointer<NSColor>, Int, NSCompositingOperation)

Fills the rectangles in a list using the specified colors and compositing operation.

func NSRectFillUsingOperation(NSRect, NSCompositingOperation)

Fills a rectangle using the current fill color and the specified compositing operation.

func NSSetFocusRingStyle(NSFocusRingPlacement)

Specifies how a focus ring will be drawn.

Graphics-Window Depth

func NSAvailableWindowDepths()

Returns the available window depth values.

func NSBestDepth(String, Int, Int, Bool, UnsafeMutablePointer<ObjCBool>?)

Attempts to return a window depth adequate for the specified parameters.

func NSBitsPerPixelFromDepth(NSWindowDepth)

Returns the bits per pixel for the specified window depth.

func NSBitsPerSampleFromDepth(NSWindowDepth)

Returns the bits per sample for the specified window depth.

func NSColorSpaceFromDepth(NSWindowDepth)

Returns the name of the color space corresponding to the passed window depth.

func NSNumberOfColorComponents(String)

Returns the number of color components in the specified color space.

func NSPlanarFromDepth(NSWindowDepth)

Returns whether the specified window depth is planar.

Key Value Bindings

func NSIsControllerMarker(Any?)

Tests whether a given object is special marker object used for indicating the state of a selection in relation to a key.

Panels

func NSReleaseAlertPanel(Any!)

Disposes of an alert panel.

Deprecated

Pasteboards

func NSCreateFileContentsPboardType(String)

Returns a pasteboard type based on the passed file type.

func NSCreateFilenamePboardType(String)

Returns a pasteboard type based on the passed file type.

func NSGetFileType(String)

Returns a file type based on the passed pasteboard type.

func NSGetFileTypes([String])

Returns an array of file types based on the passed pasteboard types.

System Beep

Additional information on sounds can be found in NSSound.

func NSBeep()

Plays the system beep.