Low frame rate during UINavigationController push transition

后端 未结 2 1209
傲寒
傲寒 2021-01-15 02:31

I have a UINavigationController, and push from the root view controller to the next view controller. This second view controller is fairly \"heavy\", in that it

2条回答
  •  伪装坚强ぢ
    2021-01-15 03:09

    I have not stumbled upon this with the navigation controller but I got much the same result when updating a table view from another thread, the UI was really slow to update at first but after a short delay everything was showing again. As Justin points out in a comment, you should do UI work on the main thread. A simple way to accomplish this is wrap your call to the UI in a GCD block:

    dispatch_sync(dispatch_get_main_queue(), ^{
    // Do UI stuff here
    });
    

    or use

    performSelectorOnMainThread:withObject:waitUntilDone:

提交回复
热议问题