我想用以下原生相机实现相同的行为iOS5:
归档它的理想方式是什么?有没有办法捕捉音量键按下事件?
谷歌搜索和搜索了几个小时后,我找到了一个解决方案:使用NSNotificationCenter:
...
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(volumeChanged:)
name:@"AVSystemController_SystemVolumeDidChangeNotification"
object:nil];
...
- (void)volumeChanged:(NSNotification *)notification{
[self takePhoto];
}
Run Code Online (Sandbox Code Playgroud)
但是,它有两个问题: