I just begun to code iOS apps with xCode and it's not very easy nor intuitive to find how things work. I'm very new into this and my app goes on very slowly ^^. Anyway, I'm now trying things on iOS7, at least.
I managed to create dynamic tables with customs cells and dynamic height but now I don't find any solution to my problem... Maybe I didn't search at the right place... anyway.
I have an audio playing, thanks to these lines:
NSString *path = [[NSBundle mainBundle] pathForResource:@"song" ofType:@"mp3"];
AVAudioPlayer *audio = [[AVAudioPlayer alloc]
initWithContentsOfURL:[NSURL fileURLWithPath:path] error:nil];
[audio play];
[audio updateMeters];
Now, that's great, my audio plays. But I don't have any controls. I successfully added a play/pause button, but how to navigate inside the audio? Do I have to code ALL the interface? There isn't a simple interface with a button and a responsive progress bar?
And if I have to code it, well, hum... where do I start?
Thanks a lot!
Use a UISlider with AVAudioPlayer's playAtTime: Method, there is no built-in seek bar for AVAudioPlayer.
Check out this sample code, it implements what you want in the class avTouchController
https://developer.apple.com/library/ios/samplecode/avTouch/Introduction/Intro.html
add a UISLider to you interface and link the valueChanged: to the method seekTime:
in .h
in .m in viewDidLoad after loading AVAudioPlayer,
and add the following method