Thank you Xuelunw for your answer.
Yes, you're right.
I found UIScreen shouldn't be used for this purpose
as I asked this to Apple Developer Technical Support and gotten the answer.
Here is what it is explained:
As your app supports resizing, using the UIScreen values for layout calculations won’t work. UIScreen returns you information about the hardware display. On an iOS device before multi-tasking, these values could be a proxy for the available space to layout your interface, but with iOS multi-tasking, your app might only be allocated a fraction of that space, so the values returned from UIScreen ceased to be useful for layout purposes at that point. On macOS, that continues to be true — UIScreen is returning you information about the hardware display, which now might be as large as a desktop display, and your window can be placed at any size and at any position on the screen.
Rather than using UIScreen for layout calculations, you should look for something more local to use for the layout calculations. This might be information in a view controller, a specific view, a scene, or a window.
.... so, I changed it to the local value, then it works as expected now.
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: