Skip to content

Instantly share code, notes, and snippets.

@MP0w
Created January 20, 2014 19:47
Show Gist options
  • Save MP0w/8527677 to your computer and use it in GitHub Desktop.
Save MP0w/8527677 to your computer and use it in GitHub Desktop.
Pluck?
//place a button somewhere and add a target with selector showMusic:
//....
-(void)showMusic:(UIButton *)aButtonPlacedSomewhere{
MPMediaPickerController* picker=[[MPMediaPickerController alloc] initWithMediaTypes:MPMediaTypeMusic];
picker.showsCloudItems=YES;
picker.allowsPickingMultipleItems=YES;
picker.delegate=self;
[self presentViewController:picker animated:NO completion:NULL];
}
//delegate!
- (void)mediaPicker: (MPMediaPickerController *)mediaPicker didPickMediaItems:(MPMediaItemCollection *)items{
//play the cool song picked!
[[MPMusicPlayerController iPodMusicPlayer] setQueueWithItemCollection: items];
[[MPMusicPlayerController iPodMusicPlayer] play];
//not tested but is something like that
}
@AdiSai
Copy link

AdiSai commented Jan 20, 2014

Pluck 2 v.s. Pluck 1?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment