in swift if a long running throwing function is called from the main thread will I be blocking my UI? Or do throwing functions occur asynchronously automatically? Just wondering if I should dispatch it off the main thread or if that will be redundant.
Asked
Active
Viewed 822 times
1
-
a throwing function is not different from any other function. – njzk2 May 19 '16 at 22:11
1 Answers
1
The function will run on which ever queue you call it on. If it is a long running function as you say I would suggest firing it off on a background queue so that you don't risk it tying up your main queue.
If you would like more background info (pun intended) checkout Objc.IO article Concurrency APIs on OS X and iOS
This diagram is from the article and quite useful for visualizing queues.

Peter Hornsby
- 4,208
- 1
- 25
- 44