Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set scrollview content size in swift 3.0 [duplicate]

After updated Xcode8 not able to set contentSize for ScrollView. I can't able to use CGSizeMake. Can anyone help me?

I have tried

scrollView.contentSize = CGSizeMake(self.view.frame.size.width, 700)
like image 749
Govindharaj Murugan Avatar asked Sep 29 '16 13:09

Govindharaj Murugan


1 Answers

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.

like image 97
Nirav D Avatar answered Oct 13 '22 14:10

Nirav D