In my app i need to detect whether ImagePicker
is ready to take photo. I found a solution here: How to know if iPhone camera is ready to take picture?
So i've got this code in viewDidLoad:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(showButton:)
name:AVCaptureSessionDidStartRunningNotification object:nil];
and selector looks like this:
- (void)showButton:(NSNotification *)notification{
NSLog(@"---CAMERA READY");
[button setHidden:NO];
[button setAlpha:0.0];
[button setTransform:CGAffineTransformScale(CGAffineTransformIdentity, 1.5, 1.5)];
[UIView animateWithDuration:.2 delay:0.0 options:UIViewAnimationOptionCurveEaseOut animations:^{
[button setAlpha:1.0];
[button setTransform:CGAffineTransformScale(CGAffineTransformIdentity, 1.0, 1.0)];
} completion:^(BOOL finished) {
}];
NSLog(@"---CAMERA READY");
}
And here is something strange happening, because both NSLogs shows up immediately, but whole button animation fires even 30 secs after.
Does UIView updates separately? How do i sync both logs and animation?