TheNewBie
TheNewBie

Reputation: 105

Reload data in ViewController after asynchronous method finished

I have a UIViewController with an UIImageView display an initial image.

I use asynchronous to download another image --> store in Directory, then I change the UIImageView to my new downloaded image.

Therefore, I want the UIViewController refresh to process new data. Is there any method in UIViewController similar to reloaddata() in TableViewController?

PS: I don't want delete ImageView and add new Subview in this case.

Upvotes: 0

Views: 1924

Answers (1)

tukbuk23
tukbuk23

Reputation: 71

I think I would need more information to fully answer the question, but if you change the .image property of the UIImageView, then the image should change. It's possible that you might have to do that on the main queue for it to work properly because UI changes have to be done in the main queue.

dispatch_async(dispatch_get_main_queue()) {
    //Change UIImageView.image property here
}

Upvotes: 1

Related Questions