0

When I present a MPMediaPickerController in iOS7, the default tab is the Playlists tab.
How do I change the default tab to the Songs tab?
I have searched everywhere and I cannot find a solution, but I know it is possible because I see that other apps have done this.

Here is how I'm presenting the media picker controller:

- (void)showPicker {
    MPMediaPickerController *mediapicker = [[MPMediaPickerController alloc] initWithMediaTypes:MPMediaTypeAnyAudio];
    mediapicker.delegate = self;
    mediapicker.prompt = @"Select a song";
    [mediapicker setAllowsPickingMultipleItems:YES];
    [mediapicker setShowsCloudItems:YES];
    [self presentViewController:mediapicker animated:YES completion:nil]; 
}
thisiscrazy4
  • 1,905
  • 8
  • 35
  • 58

1 Answers1

0

You can not change the default tab of the MPMediaPickerController, prior to iOS 7 the defaults tab of the MPMediaPickerController was songs tab, but in ios 7 they have changed it to playlist tab! The applications which you might have seen would have been running on ios 6 or less.

For more info you can check the apple's documentation which doesn't mention anything like this.

Sorry, It's not a regular UITabBarController.

It's a guess but can you try following, it might work changing the init with Media Type to MPMediaTypeMusic!

MPMediaPickerController *picker =
[[MPMediaPickerController alloc] initWithMediaTypes: MPMediaTypeMusic];
Harsh
  • 2,852
  • 1
  • 13
  • 27
  • The apps that do this are running on iOS 7, I just checked. – thisiscrazy4 Mar 10 '14 at 08:56
  • Then are you sure that it's MPMediaPickerController, because i have read the entire documentation, it no where touches upon setting the tabs programmatically. – Harsh Mar 10 '14 at 08:59
  • It looks just like one, but I can't tell for sure. Here's an app that does it, for example https://itunes.apple.com/us/app/alarm-clock-hd-free/id476555713?mt=8 – thisiscrazy4 Mar 10 '14 at 09:01
  • I have verified with another app and they are using an MPMediaPickerController and the default tab is the songs tab. – thisiscrazy4 Mar 14 '14 at 04:16
  • Can you add the code where you are adding it as a controller? It will be helpful! may be i can help you with this – Harsh Mar 14 '14 at 06:25
  • Just a guess `MPMediaPickerController *picker = [[MPMediaPickerController alloc] initWithMediaTypes: MPMediaTypeMusic];` Can you try this and let me know that it worked for you or not! Change the initWithMediaType! – Harsh Mar 14 '14 at 10:09
  • Tried that, doesn't seem to make a difference. – thisiscrazy4 Mar 14 '14 at 18:31
  • Try using different initWithMediaTypes! If something will it'll be the initialize part! Try some diff values. Rest nothing can help you as if now. – Harsh Mar 14 '14 at 18:49