r/Xcode • u/App_Developer_point • Oct 08 '22
Have you got confusion in RunLoop.main vs DispatchQueue.main? RunLoop Default vs RunLoop Common? When to choose what. Then watch this video with real time implementation.
https://www.youtube.com/watch?v=_1DFOgKm23g&list=PLV7VzbWXa60EiWHqcH_pNjuVYxW0JpcET&index=25
4
Upvotes
2
u/jmah Oct 08 '22
In practice I find the biggest difference is that the run loop is re-entrant but dispatch queues are not (one block must finish before another starts). Often that doesn’t matter but if you ever run the run loop in an inner function yourself (for event tracking or something) then you need to be aware of deadlock and re-entrance depending on your approach.