This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed. Find sources: "AppKit" – news ·newspapers ·books ·scholar ·JSTOR(March 2024) (Learn how and when to remove this message) |

AppKit (formallyApplication Kit)[1] is agraphical user interfacetoolkit. It initially served as the UI framework forNeXTSTEP.[2] Along withFoundation andDisplay PostScript, it became one of the core parts of theOpenStep specification of APIs. Later, AppKit and Foundation became part ofCocoa, theObjective-C API framework ofmacOS.GNUstep,GNU's implementation of the OpenStep/Cocoa API, also contains an implementation of the AppKit API.
AppKit comprises a collection ofObjective-Cclasses andprotocols that can be used to build an application in OpenStep/Cocoa. These classes can also be used inSwift through its Objective-C bridge.Xcode has built-in functionality for developing a Cocoa application using AppKit, including the ability to visually design user interfaces withInterface Builder. It relies heavily on patterns likereference types,delegation,notifications,target–action, andmodel–view–controller. A sign of the NeXTSTEP heritage, AppKit's classes and protocols still use the "NS" prefix.
Most of the applications bundled with macOS—for example, theFinder,TextEdit,Calendar, andPreview—use AppKit to provide their user interface.
macOS,iOS,iPadOS, andtvOS also support other UI frameworks, includingUIKit, which is derived from AppKit and uses many similar structures, andSwiftUI, aSwift-only declarative UI framework.
Prior tomacOS Catalina, macOS also supportedCarbon, a UI framework derived from theMacintosh Toolbox.
Of the more than 170 classes included in the Application Kit, the following classes form the core:[3]
NSApplication: a singleton object that represents the application as a whole and tracks its windows and other global stateNSWindow: an object representing a window on screen, it holds a hierarchy of viewsNSView: an object representing a rectangular region; it may draw UI content of its own (using drawing engines likeQuartz,Core Animation, andMetal), and it may also hold a subtree of other viewsNSResponder: an object that can respond to events during the application's lifetime;NSApplication,NSWindow, andNSView are all subclasses ofNSResponderNSDocument: an object representing a document saved on disk that manages its display in a windowNSController: anabstract class implementing some functionality for acontroller, mediating between views and model objects