Created
January 20, 2014 19:47
-
-
Save MP0w/8527677 to your computer and use it in GitHub Desktop.
Pluck?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Pluck 2 v.s. Pluck 1?