iosuiscrollviewuiscrollviewdelegate

UIScrollView scrollViewWillBeginDragging not called when content size small


UIScrollView delegate method not called when its content size is small. Is there any way to get event of scrollViewWillBeginDragging

func scrollViewWillBeginDragging(_ scrollView: UIScrollView)

Solution

  • I am able to fix it, I feel that UIScrollView behaviour to not allow scroll for smaller content is logical. In my case, requirement was to get UIScrollViewDelegate's func scrollViewDidScroll(_ scrollView: UIScrollView) method. I am able to fix it after setting scrollview property

    .alwaysBounceHorizontal = true
    

    Thank you @DonMag for suggestion.