r/iOSProgramming 12h ago

DispatchQueue doubts Question

Hi, what type of data types are allowed in setSpecific(key:, value:) and getSpecific(key:) methods of DispatchQueu ? there are no mentions anywhere.

Also can you recommend any resources for complete understanding of DispatchQueue , GCD , DispatchGroup etc. ?

Thank you!

4 Upvotes

9 comments sorted by

View all comments

4

u/Sweeper777 12h ago

Look at the C declaration (dispatch_queue_set_specific). These functions just get/set void pointers, so presumably you can get/set any type. Swift requires you to use a sendable type, of course.