I have a popup which need to be show until all the images are uploaded on the view controller, I use dispatch-async method to show the popup before all the images are uploaded and hide as the images display.
But the UIView
screen freezes displaying hang popup on calling dispatch_async
method where I was wrong in the code or whats the best way to achieve this.
func imageIconTapped(gesture: UITapGestureRecognizer){
self.loadingPopUp = showPopUp(self, txt: “Processing..")
self.navigationController!.view.addSubview(self.loadingPopUp!)
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) {
code to getting the image // getting the images is time taking therefore it work in the background.
dispatch_async(dispatch_get_main_queue()) {
method to upload the images on the view controller and hide the popup.
}