If I create a worklow that runs the sample code in the docs for the ui module found here: getting started it works as described and expected.
However, if I change it to the following:
import ui
def button_tapped(sender):
sender.title = 'Hello'
view = ui.View() # [1]
view.name = 'Demo' # [2]
view.background_color = 'white' # [3]
button = ui.Button() # [4]
button.title='Tap me!'
button.center = (view.width * 0.5, view.height * 0.5) # [5]
button.flex = 'LRTB' # [6]
button.action = button_tapped # [7]
view.add_subview(button) # [8]
view.present('sheet') # [9]
(i.e. Moving the title assignment to a separate line), it doesn't work. The button doesn't appear. Any idea why? I assume that button titles can be changed after the fact b/c the button_tapped function in the original code sample worked.