Create CGRect with short way - swift
Another way for 0,0
let rect = CGRect(
origin: CGPointZero,
size: UIScreen.main.bounds.size
)
Swift adds a special initializer to CGRect
that does just that.
let rect = CGRect(
origin: CGPoint(x: 0, y: 0),
size: UIScreen.mainScreen().bounds.size
)
For Swift 3.0 you would do this...
let rect = CGRect(
origin: CGPoint(x: 0, y: 0),
size: UIScreen.main.bounds.size
)