Refreshing iOS view immediately

Invalidating a region on a window will cause the region to be redrawn on the next drawRect which will not occur immediately. To force the redraw immediately, set the image by using performSelectorOnMainThread and wait for call to return.

[self.imageView performSelectorOnMainThread:@selector(setImage:) withObject:UIGraphicsGetImageFromCurrentImageContext() waitUntilDone:YES];