The .hidden = true
change will not become visible until the execution path returns to the main runloop. The second line is probably blocking for a few seconds, preventing these changes from occuring (or drawRect
is taking a long time further down the pipeline).
The simplest fix would be to defer the second line until the next runloop iteration:
self.vignetteView.hidden = YES;
// defer execution so the above changes are immediately visible
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
lupeItself = [[LoupeView alloc] initWithView:_pageView setZoomImageName:_zoomPageImageName setDelegate:self];
}];
Also, a minor point: you should use the constants YES
and NO
for BOOL
properties and arguments, instead of true
and false
.