samedi 1 août 2015

how to create own custom listener in iOS?

I have two views on which images are loading from server.Images are loaded asynchronously.So when loading of images is done i want to call a function or execute a block of code.So how can i create a listener which listen to loading of images. I have three images on view for loading of each image I am using below code to load images from server.

 dispatch_async(queue, ^{


            NSString *urlString=[IMAGE_BASE_URL stringByAppendingString:bc.logo];
            NSLog(@"logo url is %@",urlString);
            NSURL *logo_url = [NSURL URLWithString:urlString];
            NSData  *logo_image_data= [NSData dataWithContentsOfURL:logo_url];

            UIImage *logo_imge= [UIImage imageWithData:logo_image_data];
            dispatch_async(dispatch_get_main_queue(), ^{

                     self.img_front_logo.image = logo_imge;




            });
        });

I want to get notification in my class when loading of all three images is done not for single image.

I am beginner in iOS so don't have any idea about this?

Aucun commentaire:

Enregistrer un commentaire