Expand description

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.

Re-exports

pub use objc2::ffi::NSInteger;
pub use objc2::ffi::NSUInteger;

Structs

TODO

A string that has associated attributes for portions of its text.

A static byte buffer in memory.

A mutable string that has associated attributes.

A dynamic byte buffer in memory.

A dynamic plain-text Unicode string object.

A point in a Cartesian coordinate system.

A collection of information about the current process.

TODO.

The location and dimensions of a rectangle.

A two-dimensional size.

A static, plain-text Unicode string object.

A thread of execution.

A universally unique value.

Enums

Constants that indicate sort order.

Traits

Functions

Whether the current thread is the main thread.

Whether the application is multithreaded according to Cocoa.

Type Definitions

The basic type for all floating-point values.

Attributes that you can apply to text in an attributed string.