20 releases
new 0.5.0 | Dec 3, 2023 |
---|---|
0.4.1 | Jul 31, 2023 |
0.4.0 | Jun 20, 2023 |
0.3.0-beta.5 | Feb 7, 2023 |
0.3.0-alpha.4 | Nov 22, 2021 |
#7 in macOS and iOS APIs
131,969 downloads per month
Used in 880 crates
(16 directly)
1MB
14K
SLoC
objc2
Objective-C interface and runtime bindings in Rust.
Most of the core libraries and frameworks that are in use on Apple systems are written in Objective-C; this crate enables you to interract with those.
This crate is part of the objc2
project,
see that for related crates, or see the docs for a
more thorough overview.
Example
use objc2::ffi::NSUInteger;
use objc2::rc::Id;
use objc2::runtime::NSObject;
use objc2::{msg_send, msg_send_id, ClassType};
let obj: Id<NSObject> = unsafe { msg_send_id![NSObject::class(), new] };
let hash: NSUInteger = unsafe { msg_send![&obj, hash] };
println!("NSObject hash: {}", hash);
More examples are available in the repository.