Doevents or force update in iOS

Prior to an intensive bit of code, I would like to

  • make some control become visible, or
  • force a repaint of a canvas, or
  • even change the title of a screen

But so far all my attempts have failed - whatever I change prior to the code section, doesnt (visibly) happen before the code executes.

There is no doevents.
DelayMBS doesnt do it.
somecanvas.refresh doesnt do it.

How can I FORCE a UI update before the code starts?

Use a timer with a very short period that runs the intensive code.

Maybe Timer.CallLater 0, WeakAddressOf SoneMethodOnMainThread

This is called in the mext main loop cycle.

Thus call your refresh, then your code in SoneMethodOnMainThread thats run right after the call

1 Like

Thanks both. Both solutions work

1 Like