0

I am developing an app that requires a completion block and a "barrier" functionality. As far as I know, NSOperation API has a completionBlock property and GCD API has the dispatch_barrier_(a)sync function to handle the barrier needs.

What should I do in order to accomplish both of the needs? Thanks!

Rob
  • 415,655
  • 72
  • 787
  • 1,044
user-123
  • 874
  • 1
  • 13
  • 34

1 Answers1

1

dispatch_group should have all the pieces you need. Just dispatch_group_async/dispatch_group_enter for your work units, then dispatch_group_notify for your completion handler.

Catfish_Man
  • 41,261
  • 11
  • 67
  • 84