Quantcast
Viewing latest article 37
Browse Latest Browse All 757

Getting Started with LiveCode - Experienced Developers • orientationChanged vs. resizeStack on iPhone

According to the docs, "The orientationChanged message is sent before any automatic interface rotation takes place..." and "The resizeStack message is sent after the resizing is finished." But on my iPhone 12, at least, I am seeing "weirdness".

I have the following code:

CODE:

on orientationChanged  log "orientationChanged"end orientationChangedon resizeStack pNewW, pNewH, pOldW, pOldH  log "resizeStack"  send "updateInterface" to me in 0 millisecondsend resizeStackon updateInterface  log "updateInterface"end updateInterface
Given that orientationChanged fires before the screen rotates and resizeStack fires after, you would expect to see
orientationChanged
resizeStack
updateinterface
over and over again every time you rotate the device. And sometime you do see that. But other times you see the opposite - resizeStack first followed by orientationChanged.

Here is the log off my iPhone 12 as I rotate my device from "portrait" to "landscape left" and back again.
orientationChanged
resizeStack
updateInterface
resizeStack
updateInterface
orientationChanged
resizeStack
updateInterface
orientationChanged
orientationChanged
resizeStack
updateInterface
resizeStack
updateInterface
orientationChanged
There doesn't seem to be any rhyme or reason to it. Sometimes one fires first, and sometimes the other does. My macbook is too old and slow to run the xcode simulator without crashing, so I haven't tried this on anything but my physical iPhone. I'll get a hold of my son's macbook and try this one the simulator and see if it still happens. But is there something obvious I'm missing? Do I not understand how this message path works? Is my phone messed up?

Statistics: Posted by bamakojeff — Thu Mar 13, 2025 3:23 am



Viewing latest article 37
Browse Latest Browse All 757

Trending Articles