I want to get the origin of scrollView in the window coordinate system. For Example, presently, scollView origin is (0,51). But in window coordinate system it should be 51 +
Swift:
In viewDidAppear(otherwise elements are not yet layered) of your ViewController:
var yourFrame = yourScrollView.convertRect(yourScrollView.frame, to: self.view)
//PRINT THE WHOLE RECT
print(yourFrame)
//PRINT A DETAILED VERSION OF THE FRAME, ALSO CAN PERFORM CALCULATION BETWEEN THE RECT PARAMETERS TO GET , FOR EXAMPLE, WIDTH POINT IN THE SUPERVIEW:
print("X: \(yourFrame.origin.x) Y: \(yourFrame.origin.y) WIDTH: \(yourFrame.width) HEIGHT: \(yourFrame.height)")