|
1 | 1 | //! # Bindings to Apple's frameworks
|
2 | 2 | //!
|
3 |
| -//! This crate is a mostly autogenerated interface to some of Apple's |
4 |
| -//! frameworks. It builds upon [`objc2`] to provide memory management and |
5 |
| -//! safety in many areas; see that crate for more details. |
| 3 | +//! `icrate` is an autogenerated interface to Apple's Objective-C frameworks |
| 4 | +//! like AppKit, Foundation, Metal, WebKit, and so on. |
| 5 | +//! |
| 6 | +//! The bindings currently contain very little documentation, you should view |
| 7 | +//! [Apple's developer documentation][apple-doc-index] for detailed |
| 8 | +//! information about each API. (There are [plans][#309] for importing that |
| 9 | +//! documentation here). |
| 10 | +//! |
| 11 | +//! [#309]: https://github.com/madsmtm/objc2/issues/309 |
| 12 | +//! [apple-doc-index]: https://developer.apple.com/documentation/technologies |
| 13 | +//! |
| 14 | +//! |
| 15 | +//! ## Example |
| 16 | +//! |
| 17 | +//! ```console |
| 18 | +//! $ cargo add icrate --features=Foundation,Foundation_all |
| 19 | +//! ``` |
| 20 | +//! |
| 21 | +#![cfg_attr( |
| 22 | + all( |
| 23 | + feature = "Foundation", |
| 24 | + feature = "Foundation_NSArray", |
| 25 | + feature = "Foundation_NSString" |
| 26 | + ), |
| 27 | + doc = "```" |
| 28 | +)] |
| 29 | +#![cfg_attr( |
| 30 | + not(all( |
| 31 | + feature = "Foundation", |
| 32 | + feature = "Foundation_NSArray", |
| 33 | + feature = "Foundation_NSString" |
| 34 | + )), |
| 35 | + doc = "```ignore" |
| 36 | +)] |
| 37 | +//! use icrate::Foundation::{ns_string, NSCopying, NSArray}; |
| 38 | +//! |
| 39 | +//! let string = ns_string!("world"); |
| 40 | +//! println!("hello {string}"); |
| 41 | +//! |
| 42 | +//! let array = NSArray::from_id_slice(&[string.copy()]); |
| 43 | +//! println!("{array:?}"); |
| 44 | +//! ``` |
6 | 45 |
|
7 | 46 | #![no_std]
|
8 | 47 | #![cfg_attr(feature = "unstable-docsrs", feature(doc_auto_cfg))]
|
@@ -34,11 +73,6 @@ extern crate std;
|
34 | 73 |
|
35 | 74 | #[cfg(doctest)]
|
36 | 75 | #[doc = include_str!("../README.md")]
|
37 |
| -#[cfg(all( |
38 |
| - feature = "Foundation", |
39 |
| - feature = "Foundation_NSString", |
40 |
| - feature = "Foundation_NSArray" |
41 |
| -))] |
42 | 76 | extern "C" {}
|
43 | 77 |
|
44 | 78 | #[cfg(feature = "objective-c")]
|
|
0 commit comments