Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MPRemoteCommandCenter *commandCenter = [MPRemoteCommandCenter sharedCommandCenter];
- [commandCenter.togglePlayPauseCommand addTargetWithHandler:^MPRemoteCommandHandlerStatus(MPRemoteCommandEvent * _Nonnull event) {
- NSLog(@"toggle button pressed");
- return MPRemoteCommandHandlerStatusSuccess;
- }];
- [commandCenter.togglePlayPauseCommand addTarget:self action:@selector(toggleButtonAction)];
- [commandCenter.togglePlayPauseCommand removeTarget:self];
- [commandCenter.togglePlayPauseCommand removeTarget:self action:@selector(toggleButtonAction)];
- @import MediaPlayer;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement