iOS开发之:监听音量键

1、添加通知

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(volumeChanged:) name:@"AVSystemController_SystemVolumeDidChangeNotification" object:nil];

[[UIApplication sharedApplication] beginReceivingRemoteControlEvents];

你可能感兴趣的:(iOS,ios,ios开发,监听,音量键)