PresentModalViewController takes a long time and the screen is running

I am trying to add a UiActivityStatus and show "Please wait for image" while there is a current loading of the ModalViewController which takes 16-20 seconds ...

The image appears, but then the screen immediately turns white and sits there for 16-20 seconds. My guess is that the call to presentModalViewController returns immediately.

Anyway, the status is shown when the presentModalViewController call takes a long time.

PS: it will take a long time before I upload about 100 images in this view

thanks!!

0


a source to share


1 answer


I am assuming you are loading images in your viewControllers loadView. You can preload a view by sending it a message with a message [myViewController view]

that will trigger the load. The view is displayed when you add it to the subview. so your code will look like this:

  • Display activity indicator
  • send view message
  • push modal view controller
  • hide activity indicator


I would advise you to change your design. A pause of 16-20 seconds without user interaction is not good. Why not have a modal view that is active when images appear. You can load every image that is seen first, and whist they load, you can display a counter in its place.

0


a source







All Articles