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

objc2-foundation

Bindings to the Objective-C Cocoa Foundation framework

7 releases

Uses new Rust 2021

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.2.0-alpha.2 Nov 22, 2021
0.1.1 Nov 19, 2021

#72 in macOS and iOS APIs

Download history 15/week @ 2022-03-11 27/week @ 2022-03-18 3/week @ 2022-03-25 3/week @ 2022-04-01 10/week @ 2022-04-08 5/week @ 2022-04-15 5/week @ 2022-04-22 43/week @ 2022-04-29 44/week @ 2022-05-06 106/week @ 2022-05-13 23/week @ 2022-05-20 53/week @ 2022-05-27 48/week @ 2022-06-03 29/week @ 2022-06-10 12/week @ 2022-06-17 4/week @ 2022-06-24

100 downloads per month
Used in menubar

MIT license

125KB
3K 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

~145KB