Buttons in the UI are able to be tied to a function with the action attribute but when Creating a Textfield or TextView it does not have this option in the UI inspector. How do you get it to store what you input in the Textfield into a variable so that you can use it?
I can do it without the UI (see below) by using the action attribute of Textfield but this is not available in UI inspector.
```
import ui
view = ui.View(name = 'Demo',
frame=(0,0,500,300),
background_color = 'white')
def tfaction(sender):
st = sender.text
print(st)
text_field = ui.TextField(frame=(0,0,300,75),
placeholder = 'Enter text.',
action=tfaction)
How do i make the above work with the .pyui when it doesnt have a field for (action)? I dont understand delegates at all.
user_input = text_field.text
print(user_input)
view.add_subview(button1)
view.add_subview(text_field)
view.present('sheet') ```