To make it short:
Do never ever give a project a frameworks name! I called my project "CoreGraphics".
Original question:
I cant use CoreGraphics in a newly created simple Single View Application
- I start Xcode 6.0.1 (6A317)
- New Project: Single View Application: Swift
- New File: Cocoa Touch Class "CustomView" of type
UIView - I uncomment the template for
drawRect(rect: CGRect) {}
Compiler Error: Use of undeclared type 'CGRect'.
import UIKitis in place- I tried to add CoreGraphics to "Linked Frameworks and Libraries"
- I already restarted Xcode (and my Mac)
Update
- I installed Xcode 6.1 (6A1046a) opened and recreated my simple project.
Same issue: Compiler Error: Use of undeclared type 'CGRect'.
Any further suggestions?
Don't name your Project "CoreGraphics"
Guys you WON'T believe this. Do never ever give a project a frameworks name! I called my project "CoreGraphics". This caused the compiler error. Its reproducable. Issue closed.
来源:https://stackoverflow.com/questions/26399956/xcode-6-0-1-swift-uikit-coregraphics-missing