A
A
APP-app2014-08-21 10:58:58
iOS
APP-app, 2014-08-21 10:58:58

How to make an activity indicator when uploading a photo in an ios application?

It turned out only to call the indicator when loading the page, how to do something similar when sliding, loading a photo?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Flie, 2014-08-21
@APP-app

You need to separate the load methods into a separate thread. Start UIActivityIndicator in the main thread, and start the photo upload in the background thread. As soon as it ends, go to the main thread and display the downloaded content.
For these purposes, it is convenient to use GCD

//  запускаем индикатор
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0), ^{
        // грузим контент
        dispatch_async(dispatch_get_main_queue(), ^{
           // останавливаем индикатор и отображаем загруженный контент
        });
    });

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question