Hi,
" In two spots, you add [weak self] to capture a weak reference to self in each closure. If you aren’t familiar with capture lists, check out this tutorial on memory management."
After reading that article, it seems that weak self isn’t necessary.
I’m getting somethign wrong?
The DispatchQueue doesn’t create any retain cycle, so in this case, it may be useless.
But avoiding it will lead to waiting for all the tasks to be finished before the ViewController can be deallocated.
Thank you for this tutorial and the update!
Early in tutorial 1 of 2, under the section “Understanding Queue Types”, specific to the Concurrent bullet… it is stated: “Four such queues exist, each with different priorities: high, default, low and background.”
Is it really five queues? Default sits “between” .userInitiated and .utility: It is unclear to me whether or not that is really a queue, or it’s a scheduling exercise that decides between the two (making it four queues).
Could you please clarify this for me? Many Thanks!
Hi @tflawlis!
Yes, default sits between user-initiated and utility ones.
As written in the documentation:
Default tasks have a lower priority than user-initiated and user-interactive tasks, but a higher priority than utility and background tasks. Assign this class to tasks or queues that your app initiates or uses to perform active work on the user’s behalf.
Apple Documentation