When I present a viewcontroller when voice memos
is recording(The height of status bar is 40 px and red color). The presentedViewController's view frame is (0.0, 20.0, 320.0, 548.0).
I don't know the reason. But when I present a UINavigationControllerthe that rootviewcontroller is the viewcontroller, that works fine. Screenshot as below.
I print the description of each view:
(lldb) po self.pageViewController.view.description
"<_UIPageViewControllerContentView: 0x165ba360; frame = (0 20; 320 548); clipsToBounds = YES; opaque = NO; autoresize = W+H; layer = <CALayer: 0x165a57b0>>"
(lldb) po self.view.description
"<UIView: 0x166bc6b0; frame = (0 20; 320 548); autoresize = W+H; gestureRecognizers = <NSArray: 0x166bdb10>; layer = <CALayer: 0x166ac770>>"
(lldb) po self.view.superview?.description
▿ Optional<String>
- some : "<UITransitionView: 0x166bdca0; frame = (0 20; 320 548); autoresize = W+H; layer = <CALayer: 0x166bdbd0>>"
(lldb) po self.view.superview?.superview?.description
▿ Optional<String>
- some : "<UIWindow: 0x1668bb00; frame = (0 0; 320 568); autoresize = W+H; gestureRecognizers = <NSArray: 0x1668c2c0>; layer = <UIWindowLayer: 0x16689700>>"
The blue view is the presentingViewController's view.
I can solve the bug refer to Handling In-Call Status Bar with Custom Modal Presentation.
What's the reason of this bug? How can I solve the bug with any other better way?