Check Mobile App
Read now
Start a Project

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.


Great Product, Great Team, and Great Support Service. And if you want to add more features to the product, they can submit any idea that comes to your mind. They really care about their clients and we are really happy and honored to deal with Webkul.

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