2 releases

0.2.2 May 21, 2024
0.2.0 Apr 17, 2024

#92 in macOS and iOS APIs

Download history 61718/week @ 2024-08-22 56891/week @ 2024-08-29 63573/week @ 2024-09-05 57015/week @ 2024-09-12 58610/week @ 2024-09-19 64602/week @ 2024-09-26 69374/week @ 2024-10-03 69815/week @ 2024-10-10 76681/week @ 2024-10-17 76508/week @ 2024-10-24 80198/week @ 2024-10-31 82807/week @ 2024-11-07 79428/week @ 2024-11-14 64769/week @ 2024-11-21 74405/week @ 2024-11-28 67261/week @ 2024-12-05

299,745 downloads per month
Used in 1,465 crates (60 directly)

MIT license

6MB
128K SLoC

objc2-app-kit

Latest version License Documentation CI

Rust bindings to Apple's framework AppKit.

This README is kept intentionally small to consolidate the documentation, see the Rust docs for more details on this crate.

This crate is part of the objc2 project, see that for related crates.


lib.rs:

Bindings to the AppKit framework

See Apple's docs and the general docs on framework crates for more information.

Note that a lot of functionality in AppKit requires that the application has initialized properly, which is only done after the application delegate has received applicationDidFinishLaunching.

You should aspire to do all your UI initialization work in there!

NSWindow

Be careful when creating NSWindow if it's not inside a window controller; in those cases you're required to call window.releasedWhenClosed(false) to get correct memory management, which is also why the creation methods for NSWindow are unsafe.

Examples

Implementing NSApplicationDelegate for a custom class.

An example showing basic and a bit more advanced usage of NSPasteboard.

Dependencies