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
  • 392,368
  • 70
  • 743
  • 952
user-123
  • 873
  • 1
  • 12
  • 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
  • 40,261
  • 11
  • 65
  • 83