#objective-c #macos #ios #cocoa #uikit

objc2-foundation

Bindings to the Objective-C Cocoa Foundation framework

8 releases

0.2.0-alpha.6 Jul 19, 2022
0.2.0-alpha.5 Jun 13, 2022
0.2.0-alpha.4 Jan 3, 2022
0.2.0-alpha.3 Dec 22, 2021
0.1.1 Nov 19, 2021

#7 in #watchos

22 downloads per month
Used in menubar

MIT license

160KB
3.5K SLoC

objc2-foundation

Latest version License Documentation CI

Bindings to the Objective-C Cocoa Foundation framework in Rust.

This library is very much in progress, consider using the more battle-tested cocoa-foundation crate in the meantime.

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


lib.rs:

Bindings to the Objective-C Cocoa Foundation framework

The [std] equivalent for Objective-C, containing essential data types, collections, and operating-system services.

See Apple's documentation.

NOTICE: This library is very much in progress, consider using the more battle-tested cocoa-foundation crate in the meantime.

Philosophy

The Foundation framework is huge! If we aspired to map every API it exposes (a lot of it is just helper methods to make Objective-C more ergonomic), this library would never be finished. Instead, our focus lies on conversion methods, to allow easily using them from Rust.

If you find some API that an object doesn't expose (but should), we gladly accept pull requests. Anyhow, if it is something that is out of scope, these objects implement the [objc2::Message] trait, so you can always just manually implement call a method using the [objc2::msg_send!] macro.

Dependencies

~150KB