jaco129
jaco129

Reputation: 117

Xcode 6 Beta 5 Swift Playground: Cannot find symbol for CGRectMake()

Since updating to Xcode 6 beta 5 my playground code will no longer compile/run and logs:

Playground execution failed: error: Couldn't lookup symbols: _CGRectMake

It should be simple enough and worked fine on the previous versions. The only code I am running up to that point is as follows:

import Foundation
import UIKit
import XCPlayground
import QuartzCore
let frameRect: CGRect = CGRectMake(0, 0, 500, 500)
var customView = UIView(frame: frameRect)

Just wondering if anyone else is having problems with Playground and found solutions. My hunch is that is just a beta bug.

Upvotes: 3

Views: 1218

Answers (2)

dcbenji
dcbenji

Reputation: 4678

Try just removing the "make":

import Foundation
import UIKit
import XCPlayground
import QuartzCore
let frameRect: CGRect = CGRect(0, 0, 500, 500)
var customView = UIView(frame: frameRect)

Also, you may get another weird error with your view when you import XCPlayground, so try this:

customView.setTranslatesAutoresizingMaskIntoConstraints(true)

Upvotes: 3

Chris Wagner
Chris Wagner

Reputation: 21013

You should use let rect = CGRect(x: 0, y: 0, width: 500, height: 500) instead.

CGRectMake still works for me though... Did you create a new playground with beta 5? I've found it's best to always create a new playground for each new beta.

Upvotes: 3

Related Questions