I get this error in quick
'BlockColor' cannot be constructed because initializers are not available
import Foundation import SpriteKit let NumberOfColors: UInt32 = 6 enum BlockColor: Int, Printable { case Blue = 0, Orange, Purple, Red, Teal, Yellow var spriteName: String { switch self { case .Blue: return "blue" case .Orange: return "orange" case .Purple: return "purple" case .Red: return "red" case .Teal: return "teal" case .Yellow: return "yellow" } } var description: String { return self.spriteName } static func random() -> BlockColor { return BlockColor(rawValue:Int(arc4random_uniform(NumberOfColors)))! } }
I got an error on this line
return BlockColor(rawValue:Int(arc4random_uniform(NumberOfColors)))!
I look through my code many times but have not found where the error is
source share