objc2

Latest version License Documentation CI

Objective-C interface and runtime bindings for 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.

Example

```rust use objc2::{class, msgsend, msgsend_id}; use objc2::ffi::NSUInteger; use objc2::rc::{Id, Owned}; use objc2::runtime::Object;

let cls = class!(NSObject); let obj: Id = unsafe { msgsendid![cls, new] }.unwrap();

let hash: NSUInteger = unsafe { msg_send![&obj, hash] }; println!("NSObject hash: {}", hash); ```

See the docs for a more thorough overview, or jump right into the [examples].

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