-2

I am working on iOS application in swift. I need to parse two web api(XML) at application launch time and during this period, I need to show launch screen. So I sent a synchronous request to parse the data from server. If net connection is good then application working fine but due to slow net connection or it takes more then 20 seconds to load data from server it can quit automatic. How to fix this issue. Please suggest it.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Vipulk617
  • 799
  • 1
  • 7
  • 23

1 Answers1

5

You should never send synchronous requests in main thread!

Add new VC on load. There you can load your data async. When data is ready, pass it the next VC.

Timur Bernikovich
  • 5,660
  • 4
  • 45
  • 58