Advertisement
Guest User

Untitled

a guest
Sep 3rd, 2015
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. MPRemoteCommandCenter *commandCenter = [MPRemoteCommandCenter sharedCommandCenter];
  2.  
  3. [commandCenter.togglePlayPauseCommand addTargetWithHandler:^MPRemoteCommandHandlerStatus(MPRemoteCommandEvent * _Nonnull event) {
  4. NSLog(@"toggle button pressed");
  5. return MPRemoteCommandHandlerStatusSuccess;
  6. }];
  7.  
  8. [commandCenter.togglePlayPauseCommand addTarget:self action:@selector(toggleButtonAction)];
  9.  
  10. [commandCenter.togglePlayPauseCommand removeTarget:self];
  11.  
  12. [commandCenter.togglePlayPauseCommand removeTarget:self action:@selector(toggleButtonAction)];
  13.  
  14. @import MediaPlayer;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement