Today in the Detection album (Photo+camera) This part of the bug, found in the long press Photo, video or click the photo icon, and then return to the original view (Assettableviewcontroller), the view will display an error, A blank is displayed.
Here is a summary of my work ideas and debugging steps:
1. Set breakpoints to see the frame size of the view controller by setting breakpoints in both Viewwillappear and viewwilllayoutsubviews of the Returned view controllers
2. Reproduce the bug: Long according to the film or video, etc., when entering the view at the two endpoints to see the view of the frame changes!!
Specifically: It will enter the Viewwilllayoutsubviews function 3 times, and be changed in the second and third times, Y becomes 0.
3. Follow the code and be bold: discover that the returned operations have called Presentviewcontrollerhe Dismissviewcontroller at the same time (this is difficult and critical)
Trying to find a solution on the Internet, not the results! After each function by adding their own previously written by a webbrowserviewcontroller to detect, will presentviewcontroller this code to Webbrowserviewcontroller, and then return, I was surprised to find that there was no problem.
4. Try to solve: Presentviewcontroller is the Uiviewcontroller method, its implementation we can not change, so only from their own code. First the view is nested inside another view, so try
A containervc = [uiapplication sharedapplication].keywindow.rootviewcontroller for present and dismiss. Found out right after the experiment!
Although the problem solved, but still do not know why, I hope that crossing can participate in the discussion and make suggestions ~ ~
[IOS] Calls Presentviewcontroller and Dissmissviewcontroller for frame display errors