scrollViewDidEndDecelerating not executing

Either connect the delegate property of the scrollview to the File's Owner object in Interface Builder or just set the delegate manually in your ViewController's ViewDidLoad.

scrollview.delegate = self

scrollViewDidEndDecelerating is not called if the user is scrolling slowly (i.e. the scroll view does not continue to scroll on touch up). In that case the delegate calls scrollViewDidEndDragging. So to do something when the user has stopped scrolling and the scrollview has stopped you can combine them:

func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
  if !decelerate {
     endOfScroll()
  }
}

func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
  endOfScroll()
}

func endOfScroll() {
  //The user finished scrolling
}

In Objective-C

- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
{
   if(!decelerate) [self endOfScroll];
}

-(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{
  [self endOfScroll];
}

-(void)endOfScroll{
  //Do something
}