Just a newbie to the ios programming, and decided to start coding ios application using Xcode 6.1 swift language.
I created a new project. Then added a new Cocoa class DrawView. Then clicked main.storyboard main view and in the identity inspector put int he field class - DrawView.
Then I chose DrawView.swift - uncomment drawRect method and put into it
var context:CGContextRef = UIGraphicsGetCurrentContext()
CGContextClearRect(context, self.bounds)
and started a project, the problem is
Path/DrawView.swift: 11: 11: fatal error: use of unimplemented initializer 'init(coder:)' for class '_d_Quartz1.DrawView'
What shoud I do in oder to avoid this problem?
The entire code:
class DrawView: UIView {
init(frame: CGRect) {
super.init(frame: frame)
// Initialization code
}
override func drawRect(rect: CGRect)
{
var context = UIGraphicsGetCurrentContext()
CGContextClearRect(context, self.bounds)
}
}