initialisation में:
[[[captureManager videoInput] device] addObserver:self forKeyPath:@"adjustingFocus" options:NSKeyValueObservingOptionNew context:nil];
और उसके बाद:
bool focusing = false;
bool finishedFocus = false;
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{
//[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
if([keyPath isEqualToString:@"adjustingFocus"]){
BOOL adjustingFocus = [ [change objectForKey:NSKeyValueChangeNewKey] isEqualToNumber:[NSNumber numberWithInt:1] ];
if (adjustingFocus) {
focusing=true;
}
else {
if (focusing) {
focusing = false;
finishedFocus = true;
}
}
}
}
स्रोत
2014-01-17 11:59:46
धन्यवाद @ alexi-akl! यह वह कोड था जिसे मैं याद कर रहा था ... :) – cdescours
खुश मेरा जवाब सहायक था :) @cdescours –