androidiosrotationhybrid-mobile-appscreen-rotation

Does iOS destroy the views on rotation?


I'm considering building my first iOS app in the following months. This is going to a hybrid app:

https://fanmixco.github.io/toastmasters-timer-material-design/

At this point is fully migrated to Android and Windows 10. However, one of my greatest challenges in Android was the screen rotation:

This situation was quite complex to handle since each time my app was rotated the activity was destroyed and I needed to add several workarounds in order to keep the app running, restoring the previous states, colors, stop the timers before the rotation because they kept running in background, etc.

I didn't experience anything similar in Windows 10 and I'd like to know if the iOS View Life-Cycle behaves closely, are the views destroyed during the rotation of any device? Because my workarounds are reusable, but they add certain complexity and reduce performance.

These are some of the sites that I read:

Nevertheless, I haven't found anything precise about this topic.

P.S.


Solution

  • When the screen is rotated the views are not destroyed. However it is re-laid out/re-drawn based on the constraints on the view. But this won’t destroy properties or mess with state on the view.