From 9d47662230cd84c4e534641cd53ba36ed44d14ac Mon Sep 17 00:00:00 2001 From: ciciplusplus Date: Tue, 21 Jan 2025 22:54:52 +0100 Subject: [PATCH] Define UITextFieldTextDidChangeNotification constant Change-Id: Ic1454f59bfde728128fa80f342f6baf42c0b42d7 --- src/dyld/constant_lists.rs | 1 + .../uikit/ui_view/ui_control/ui_text_field.rs | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/src/dyld/constant_lists.rs b/src/dyld/constant_lists.rs index 27d6546f5d..152e4e28f4 100644 --- a/src/dyld/constant_lists.rs +++ b/src/dyld/constant_lists.rs @@ -40,5 +40,6 @@ pub const CONSTANT_LISTS: &[super::ConstantExports] = &[ opengles::eagl::CONSTANTS, uikit::ui_application::CONSTANTS, uikit::ui_device::CONSTANTS, + uikit::ui_view::ui_control::ui_text_field::CONSTANTS, uikit::ui_view::ui_window::CONSTANTS, ]; diff --git a/src/frameworks/uikit/ui_view/ui_control/ui_text_field.rs b/src/frameworks/uikit/ui_view/ui_control/ui_text_field.rs index 4ffa66f1b5..cdc3fde83b 100644 --- a/src/frameworks/uikit/ui_view/ui_control/ui_text_field.rs +++ b/src/frameworks/uikit/ui_view/ui_control/ui_text_field.rs @@ -10,6 +10,7 @@ use sdl2_sys::{SDL_StartTextInput, SDL_StopTextInput}; +use crate::dyld::{ConstantExports, HostConstant}; use crate::frameworks::core_graphics::CGRect; use crate::frameworks::foundation::ns_string::to_rust_string; use crate::frameworks::foundation::{ns_string, NSInteger, NSRange, NSUInteger}; @@ -30,6 +31,15 @@ pub type UIReturnKeyType = NSInteger; type UITextAutocapitalizationType = NSInteger; type UITextAutocorrectionType = NSInteger; +// TODO: Actually send notification on text change +const UITextFieldTextDidChangeNotification: &str = "UITextFieldTextDidChangeNotification"; + +/// `NSNotificationName` values. +pub const CONSTANTS: ConstantExports = &[( + "_UITextFieldTextDidChangeNotification", + HostConstant::NSString(UITextFieldTextDidChangeNotification), +)]; + struct UITextFieldHostObject { superclass: super::UIControlHostObject, delegate: id,