-2
CGSizeMake(view.frame.width,100)

what will be the alternative in swift 3 i tried it with

CGSize(view.frame.width,100)

but its giving me error that

"Cannot invoke initializer for type 'CGSize' with an arguement list type '(width: CGFloat, height:Int)'"

enter image description here

Ankit Baid
  • 97
  • 2
  • 10

3 Answers3

6

Since Swift 3 some frameworks have been redesigned in a Swifty way. Now you have to use this initializer to create a CGSize

let size: CGSize = CGSize(width: view.frame.width, height: 100.0)
Adolfo
  • 1,844
  • 12
  • 19
2

It's:

CGSize(width: ..., height: ...)
Vatsal Manot
  • 16,824
  • 8
  • 42
  • 78
1

Open the first parenthesis, the following dialogue will pop up

enter image description here

Now you've got an idea of what's what

Community
  • 1
  • 1
Khaled Alshammari
  • 1,946
  • 3
  • 14
  • 33