Skip to content

Commit

Permalink
Define UITextFieldTextDidChangeNotification constant
Browse files Browse the repository at this point in the history
Change-Id: Ic1454f59bfde728128fa80f342f6baf42c0b42d7
  • Loading branch information
ciciplusplus committed Jan 21, 2025
1 parent c96a346 commit 9d47662
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/dyld/constant_lists.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
];
10 changes: 10 additions & 0 deletions src/frameworks/uikit/ui_view/ui_control/ui_text_field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -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,
Expand Down

0 comments on commit 9d47662

Please sign in to comment.