class ColorRectangle: SKShapeNode {
var width: CGFloat!
var height: CGFloat!
var rectColor: UIColor!
convenience init(rectOfSize: CGSize, colorOfRectangle rectColor: UIColor) {
super.init(rectOfSize: rectOfSize)
self.width = rectOfSize.width
self.height = rectOfSize.height
self.rectColor = rectColor
self.fillColor = rectColor
self.strokeColor = rectColor
}
}
Can't get the initializer right. What do I do?
Try changing your initializer like this: