Question

Here it is. I created an UITableView in current controller, and it's static cell type. When I touched the button, will push this controller to UINavigationController, I found that it will take 3s delay to open, that's slow, sometimes we will think that we didn't touch the button correctly, kind bad UX.

So I tried Time Profile Tool and saw it invoke Calendar library, I tried to remove these two UIDatePicker from UITableView, and try it again, yes it's quick as its used to be around 1s.

So the question is how to remove this delay while it's still loading UIDatePicker in it?

enter image description here

Was it helpful?

Solution

Loading that many UIDatePickers via Storyboard is sure to slow down your navigation.

  • Create your UIDatepicker(s) programmatically
  • If you need to pass data from the picker as the view appears create in viewWillAppear
  • If you don't need any data from them until the view has been loaded create in viewDidAppear

My application required data on display so I created mine in viewWillAppear

OTHER TIPS

Solved.

  1. Remove UIDatePicker from UITableView
  2. Created UIDatePicker programmatically in viewDidAppear

Then its energy back.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top