I love new learners... Simple answer for you...
First create a UIView
in your StoryBoard, where you want to put a volume slider.
Now create a IBOutlet
for that view in your ViewController implementation.
for ex:
@property (nonatomic,strong) IBOutlet UIView* volumeView;
Now in the viewDidLoad
method write the following code:
MPVolumeView *mpVolumeView = [[MPVolumeView alloc]initWithFrame:self.volumeView.bounds];
[self.volumeView addSubview:mpVolumeView];
[mpVolumeView sizeToFit];
Now you will have volume control in your app...
Note: this code will not work for a simulator.
cheers.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…