@Steppers it appears as if the keyboard notification messages aren’t actually passing the notification objects?
function setup()
-- Hidden text field, just enough to summon keyboard
tf = objc.UITextField()
objc.viewer.view:addSubview_(tf)
-- Minimal notification handler
local Handler = objc.class("KBHandler")
function Handler:keyboardWillShow_(notification)
print("notification value:", notification)
end
local handler = Handler()
objc.NSNotificationCenter.defaultCenter:addObserver_selector_name_object_(
handler,
objc.selector("keyboardWillShow:"),
"UIKeyboardWillShowNotification",
nil
)
print("Observer installed. Tap screen.")
end
function draw() end
function touched(t)
if t.state == BEGAN then
if tf.isFirstResponder then
tf:resignFirstResponder_()
else
tf:becomeFirstResponder_()
end
return true
end
end
…is that a bug or is it something intentionally left out or am I just doing it wrong to begin with?
