From 3e4610c43108582dfd098274667d019e04184e21 Mon Sep 17 00:00:00 2001 From: Andreas Monitzer Date: Wed, 15 Oct 2025 10:51:05 +0200 Subject: [PATCH 1/4] Ignore files generated by xcodegen (#47) --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index 735cda3af7c..be2dd518b54 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,8 @@ uv.lock .python-version MODULE.bazel.lock + +# Ignore Xcode projects created by xcodegen +*.xcodeproj +*.xcworkspace +Info.plist From b44634fcb7e497fa980f6715566ef854800b0b47 Mon Sep 17 00:00:00 2001 From: Andreas Monitzer Date: Wed, 15 Oct 2025 10:54:34 +0200 Subject: [PATCH 2/4] In xcodeproj definition of the energy-monitor demo, fixed indenting and minimum deployment target. (#47) The code uses features that only appeared in iOS 16, so we can't target anything earlier than that. --- demos/energy-monitor/ios-project.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/demos/energy-monitor/ios-project.yml b/demos/energy-monitor/ios-project.yml index f5b466200b0..f97738f9ca2 100644 --- a/demos/energy-monitor/ios-project.yml +++ b/demos/energy-monitor/ios-project.yml @@ -9,15 +9,14 @@ targets: Energy Monitor: type: application platform: iOS - deploymentTarget: "12.0" + deploymentTarget: "16.6" info: - path: Info.plist - properties: - UILaunchScreen: - - ImageRespectSafeAreaInsets: false + path: Info.plist + properties: + UILaunchScreen: + - ImageRespectSafeAreaInsets: false sources: [] postCompileScripts: - script: | ../../scripts/build_for_ios_with_cargo.bash energy-monitor - outputFileLists: - $TARGET_BUILD_DIR/$EXECUTABLE_PATH + outputFileLists: $TARGET_BUILD_DIR/$EXECUTABLE_PATH From 26f4f8f0f46600838a253f2ff8c2dce84c32c40d Mon Sep 17 00:00:00 2001 From: Andreas Monitzer Date: Fri, 17 Oct 2025 10:50:43 +0200 Subject: [PATCH 3/4] iOS shared focus behavior with Android where input fields are focused on tap up rather than down. (#47) --- internal/core/items/text.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/core/items/text.rs b/internal/core/items/text.rs index 03912876331..f58baee41fb 100644 --- a/internal/core/items/text.rs +++ b/internal/core/items/text.rs @@ -807,7 +807,7 @@ impl Item for TextInput { self.as_ref().anchor_position_byte_offset.set(clicked_offset); } - #[cfg(not(target_os = "android"))] + #[cfg(not(any(target_os = "android", target_os = "ios")))] self.ensure_focus_and_ime(window_adapter, self_rc); match click_count % 3 { @@ -826,13 +826,13 @@ impl Item for TextInput { return InputEventResult::GrabMouse; } MouseEvent::Pressed { button: PointerEventButton::Middle, .. } => { - #[cfg(not(target_os = "android"))] + #[cfg(not(any(target_os = "android", target_os = "ios")))] self.ensure_focus_and_ime(window_adapter, self_rc); } MouseEvent::Released { button: PointerEventButton::Left, .. } => { self.as_ref().pressed.set(0); self.copy_clipboard(window_adapter, Clipboard::SelectionClipboard); - #[cfg(target_os = "android")] + #[cfg(any(target_os = "android", target_os = "ios"))] self.ensure_focus_and_ime(window_adapter, self_rc); } MouseEvent::Released { position, button: PointerEventButton::Middle, .. } => { From 04e4aea8954f8b7dda5f8cfef1da271c0aa609fd Mon Sep 17 00:00:00 2001 From: Andreas Monitzer Date: Fri, 17 Oct 2025 10:57:08 +0200 Subject: [PATCH 4/4] macOS and iOS share keyboard navigation behavior (#47) --- internal/core/items/text.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/core/items/text.rs b/internal/core/items/text.rs index f58baee41fb..25b7ee2c321 100644 --- a/internal/core/items/text.rs +++ b/internal/core/items/text.rs @@ -1269,10 +1269,10 @@ impl core::convert::TryFrom for TextCursorDirection { key_codes::DownArrow => Self::NextLine, key_codes::PageUp => Self::PageUp, key_codes::PageDown => Self::PageDown, - // On macos this scrolls to the top or the bottom of the page - #[cfg(not(target_os = "macos"))] + // On macOS and iOS this scrolls to the top or the bottom of the page + #[cfg(not(target_vendor = "apple"))] key_codes::Home => Self::StartOfLine, - #[cfg(not(target_os = "macos"))] + #[cfg(not(target_vendor = "apple"))] key_codes::End => Self::EndOfLine, _ => return Err(()), })