I have a callback which might come from any thread. When I get this callback, then I would like to perform a certain task on the main thread. Do...
  • May 19, 2022
  • 0 Comments
In Swift 2, I was able to create queue with the following code: let concurrentQueue = dispatch_queue_create("com.swift3.imageQueue", DISPATCH_QUEUE_CONCURRENT) But this doesn’t compile in Swift 3. What is the preferred...
  • May 7, 2022
  • 0 Comments
In Swift 2, I was able to use dispatch_after to delay an action using grand central dispatch: var dispatchTime: dispatch_time_t = dispatch_time(DISPATCH_TIME_NOW, Int64(0.1 * Double(NSEC_PER_SEC))) dispatch_after(dispatchTime, dispatch_get_main_queue(), { //...
  • May 4, 2022
  • 0 Comments
I’m learning about concurrent programming for iOS. So far I’ve read about NSOperation/NSOperationQueue and GCD. What are the reasons for using NSOperationQueue over GCD and vice versa? Sounds like...
  • May 4, 2022
  • 0 Comments
I’ve gone through the iBook from Apple, and couldn’t find any definition of it: Can someone explain the structure of dispatch_after? dispatch_after(<#when: dispatch_time_t#>, <#queue: dispatch_queue_t?#>, <#block: dispatch_block_t?#>) 26 s...
  • April 30, 2022
  • 0 Comments