Example image:
I need de height in color blue.
You can try
let height = scrollView.contentOffset.y print(height)
insert it inside scrollViewDidScroll
scrollViewDidScroll