I have added a scroll view and it scrolls horizontally.I have to play a sound when my scrolls view scrolls.For that I played my music file in
-(void)scrollViewDidScroll:(UIScrollView *)scrollView
{
AudioServicesPlaySystemSound(_scrollPewSound);
}
method. My problem is that I have to play a sound that is dependent on scroll view scrolling speed.Means if user has scroll fast the music should play fast and if the scroll view have scrolled slow the music should play slow.
If I implement this method:-
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
{
AudioServicesPlaySystemSound(_scrollPewSound);
}
then the music play just when the scroll view gets scrolled.
So these both effects are not fulfill the requirement.
Please suggest me how to implement this.
There are no property, containing "scrollspeed", but maybe, you can save you scrollview.contentOffset in some variable, then start timer with some delay, which check offset again and calculate "scrollspeed"?