Observe whether All Operation is completed or not using swift 4.2


All Operation is completed or not

In iOS basically we perform the background thread operation using GCD & OPeration, OPerationQueue.

In GCD there is DispatchGroup for handling the work is completed or not (different DispatchWorkItem ).  In Operation, there is no kind of facility for this we have to create KVO

to manage all things. here we have taken the example of 2 Operation each Operation is downloading the image.

Please follow these steps:

1: First Create Operation class that will download the image.


2: Take a controller class and Declare  OperationQueue.

Notes: It will add all the operations in the queue.

3: Write the function for operation.

Note: here op1 & op2 is separate completion of the operation.

4: Now Observe all the operation is completed or not.

Write this code in your class.

Now: Here we have implemented KVO to check whether the Queue contains operation or not.

Complete Code :



Recent Xcode, iOS and Swift Blog posts

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*

Be the first to comment.


It was a successful collaboration. The Mobikul team provided the client everything they needed in a timely and high-quality manner. They were very professional, reliable, and accessible during the entire process. The client also saw no room for any improvements in the vendor's performance.

Vincenzo Carrano

Vincenzo Carrano

Administrator, Segshop

Talk to Sales


Live Chat
Start a Project

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home