How to get Y co-ordinate of lastview in ScrollView

Hi

 

   How to get Y co-ordinate of lastview in ScrollView . Below code is not working.

 

func calculateContentSize(scrollView: UIScrollView) -> CGSize {
        var topPoint = CGFloat()
        var height = CGFloat()
       

        for subview in scrollView.subviews {
//            if subview.accessibilityIdentifier = clcViewB
//            {
//                print("Hello")
//            }
            if subview.frame.origin.y > topPoint {
                topPoint = subview.frame.origin.y
                height = subview.frame.size.height
            }
        }
        print(topPoint)
        return CGSize(width: scrollView.frame.size.width, height: height + topPoint)
    }

 

Thanks

Powered by WPeMatico

About

You may also like...

Comments are closed.