Skip to content

Commit

Permalink
UIKit is available on watchos
Browse files Browse the repository at this point in the history
  • Loading branch information
yury committed Dec 30, 2024
1 parent c384ea9 commit 1b72125
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 2 additions & 0 deletions cidre/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ fn main() {
"maccatalyst",
"appletvos",
"appletvsimulator",
"watchos",
"watchosimulator",
"visionos",
"visionsimulator",
]
Expand Down
8 changes: 4 additions & 4 deletions cidre/pomace/ui/ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
1 change: 1 addition & 0 deletions cidre/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion cidre/src/ns/attributed_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions cidre/src/ns/text_attachment.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -81,7 +81,7 @@ extern "C" {
static NS_TEXT_ATTACHMENT: &'static objc::Class<TextAttachment>;
}

#[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<TextAttachment>;
Expand Down

0 comments on commit 1b72125

Please sign in to comment.