In Swift, why is a custom serial queue with a global queue as its target not executed concurrently?

Advertisements This is my first question here, so please be nice. I struggle to understand the dynamics around a queue’s target in Swift: I have read that a custom queue inherits the behaviour of its target queue. In the example below, concurrentQueue has its attribute set to .concurrent. But because its target queue is DispatchQueue.main,… Read More In Swift, why is a custom serial queue with a global queue as its target not executed concurrently?

DispatchGroup notify before all leave called

Advertisements I have an iOS application that runs multiple classes(every class in a separate thread) and I want to get a notification when all the class finishes their run. So I have a BaseClass: class BaseClass { var completeState: CompleteState init(completeState: CompleteState) { self.completeState = completeState self.completeState.dispatch.enter() } func start() { } } And this… Read More DispatchGroup notify before all leave called

How to set a variable that runs on background thread and needs to access ui

Advertisements I am fetching a data source in background. There are 2 urls and I choose it with a tabBar. To know which url I need to access, I use navigationController?.tabBarItem.tag. But It throws an error of "navigationController must be used from main thread only". I’ve tried to wrap it with DispatchQueue.main.async but it didn’t… Read More How to set a variable that runs on background thread and needs to access ui