Raj Anjana Raj Anjana - 1 year ago 243
Swift Question

how to set scrollview content size in swift 3.0

Hi after updated Xcode8 not able to set

. I can't able to use
Can anyone help me pls

Thank U

I have tried

scrollView.contentSize = CGSizeMake(self.view.frame.size.width, 700)

Answer Source

From Swift 3 CGSizeMake is not available use CGSize init instead.

scrollView.contentSize = CGSize(width: self.view.frame.size.width, height: 700)

Check the Apple Documentation on Core Graphics as of from Swift 3 they have made a lot of changes.