diff --git a/cidre/build.rs b/cidre/build.rs index e1c493db..1f5abd62 100644 --- a/cidre/build.rs +++ b/cidre/build.rs @@ -322,6 +322,8 @@ fn main() { "maccatalyst", "appletvos", "appletvsimulator", + "watchos", + "watchosimulator", "visionos", "visionsimulator", ] diff --git a/cidre/pomace/ui/ui.h b/cidre/pomace/ui/ui.h index 57985c54..af8c76aa 100644 --- a/cidre/pomace/ui/ui.h +++ b/cidre/pomace/ui/ui.h @@ -25,11 +25,11 @@ static void ui_initializer(void) if (!initialized) { initialized = 1; - UI_DEVICE = [UIDevice class]; - UI_VIEW = [UIView class]; + UI_DEVICE = NSClassFromString(@"UIDevice");//[UIDevice class]; + UI_VIEW = NSClassFromString(@"UIView");//[UIView class]; UI_COLOR = [UIColor class]; - UI_RESPONDER = [UIResponder class]; - UI_VIEW_CONTROLLER = [UIViewController class]; + UI_RESPONDER = NSClassFromString(@"UIResponder");//[UIResponder class]; + UI_VIEW_CONTROLLER = NSClassFromString(@"UIViewController");//[UIViewController class]; UI_IMAGE = [UIImage class]; NS_TEXT_ATTACHMENT = [NSTextAttachment class]; diff --git a/cidre/src/lib.rs b/cidre/src/lib.rs index 7686b9bb..4cdbee82 100644 --- a/cidre/src/lib.rs +++ b/cidre/src/lib.rs @@ -150,6 +150,7 @@ pub mod cat; target_os = "ios", all(target_os = "ios", target_abi = "macabi",), target_os = "tvos", + target_os = "watchos", target_os = "visionos" ), feature = "ui" diff --git a/cidre/src/ns/attributed_string.rs b/cidre/src/ns/attributed_string.rs index 5c15cabb..aea3ef42 100644 --- a/cidre/src/ns/attributed_string.rs +++ b/cidre/src/ns/attributed_string.rs @@ -128,7 +128,7 @@ extern "C" { static NSWritingDirectionAttributeName: &'static AttrStringKey; } -#[cfg(any(target_os = "ios", target_os = "tvos"))] +#[cfg(any(target_os = "ios", target_os = "tvos", target_os = "watchos"))] #[link(name = "UIKit", kind = "framework")] extern "C" { static NSFontAttributeName: &'static AttrStringKey; diff --git a/cidre/src/ns/text_attachment.rs b/cidre/src/ns/text_attachment.rs index b5115d69..54b201b2 100644 --- a/cidre/src/ns/text_attachment.rs +++ b/cidre/src/ns/text_attachment.rs @@ -1,6 +1,6 @@ use crate::{arc, cg, define_obj_type, ns, objc}; -#[cfg(any(target_os = "ios", target_os = "tvos"))] +#[cfg(any(target_os = "ios", target_os = "tvos", target_os = "watchos"))] #[cfg(feature = "ui")] use crate::ui::Image; @@ -81,7 +81,7 @@ extern "C" { static NS_TEXT_ATTACHMENT: &'static objc::Class; } -#[cfg(any(target_os = "ios", target_os = "tvos"))] +#[cfg(any(target_os = "ios", target_os = "tvos", target_os = "watchos"))] #[cfg(feature = "ui")] extern "C" { static NS_TEXT_ATTACHMENT: &'static objc::Class;