Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GCRectMake error in Swift 3 with specific code [duplicate]

A quite general question. What exact syntax should I use instead of CGRectMake while coding in Swift 3?

Here is the code I would like to convert from swift 2 - 3:

{let size = text.boundingRectWithSize(CGSizeMake(view.frame.width - 26, 2000), options: NSStringDrawingOptions.UsesFontLeading.union(.UsesLineFragmentOrigin), context: nil).size}

Thanks for the help!

like image 439
user6155249 Avatar asked Dec 08 '22 21:12

user6155249


1 Answers

in Swift 3.0 this can be use

let rect = CGRect(x: 0, y: 0, width: 50, height: 50)

https://www.raywenderlich.com/135655/whats-new-swift-3

like image 124
Alupotha Avatar answered Jan 16 '23 02:01

Alupotha