2 releases

0.2.2 May 21, 2024
0.2.0 Apr 17, 2024

#135 in macOS and iOS APIs

Download history 46286/week @ 2024-07-08 53817/week @ 2024-07-15 58093/week @ 2024-07-22 59825/week @ 2024-07-29 54829/week @ 2024-08-05 52060/week @ 2024-08-12 54973/week @ 2024-08-19 63881/week @ 2024-08-26 57908/week @ 2024-09-02 58228/week @ 2024-09-09 57793/week @ 2024-09-16 63371/week @ 2024-09-23 65396/week @ 2024-09-30 71090/week @ 2024-10-07 72858/week @ 2024-10-14 76343/week @ 2024-10-21

289,898 downloads per month
Used in 1,375 crates (55 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