Skip to content

Commit

Permalink
docs: Update documentation to refer to new objc2 crates
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Apr 28, 2024
1 parent a36599d commit 57836bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/appkit.rs
Expand Up @@ -57,9 +57,9 @@ impl DisplayHandle<'static> {
/// # fn inner() {
/// #![cfg(target_os = "macos")]
/// # #[cfg(requires_objc2)]
/// use icrate::AppKit::NSView;
/// use objc2_app_kit::NSView;
/// # #[cfg(requires_objc2)]
/// use icrate::Foundation::is_main_thread;
/// use objc2_foundation::is_main_thread;
/// # #[cfg(requires_objc2)]
/// use objc2::rc::Id;
/// use raw_window_handle::{WindowHandle, RawWindowHandle};
Expand Down
7 changes: 3 additions & 4 deletions src/uikit.rs
Expand Up @@ -57,12 +57,11 @@ impl DisplayHandle<'static> {
/// # fn inner() {
/// #![cfg(any(target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "xros"))]
/// # #[cfg(requires_objc2)]
/// use icrate::Foundation::is_main_thread;
/// use objc2_foundation::is_main_thread;
/// # #[cfg(requires_objc2)]
/// use objc2::rc::Id;
/// // TODO: Use `icrate::UIKit::UIView` when available
/// # #[cfg(requires_objc2)]
/// use objc2::runtime::NSObject;
/// use objc2_ui_kit::UIView;
/// use raw_window_handle::{WindowHandle, RawWindowHandle};
///
/// let handle: WindowHandle<'_>; // Get the window handle from somewhere else
Expand All @@ -76,7 +75,7 @@ impl DisplayHandle<'static> {
/// // that the `UiKitWindowHandle` contains a valid pointer to an
/// // `UIView`.
/// // Unwrap is fine, since the pointer came from `NonNull`.
/// let ui_view: Id<NSObject> = unsafe { Id::retain(ui_view.cast()) }.unwrap();
/// let ui_view: Id<UIView> = unsafe { Id::retain(ui_view.cast()) }.unwrap();
/// // Do something with the UIView here.
/// }
/// handle => unreachable!("unknown handle {handle:?} for platform"),
Expand Down

0 comments on commit 57836bd

Please sign in to comment.