Search code examples
iosswiftuiscrollviewuiscrollviewdelegate

How to get the CGRect of the UIScrollView after scrolling?


I want to get the CGRect or just x,y of the area the scrollview currently shows after user has dragged the view when calling scrollViewDidEndDragging


Solution

  • You can use

    scrollView.contentOffset.x 
    scrollView.contentOffset.y