I have this class Minion
class GameObject : SKShapeNode {
var health : Int!
}
class Character : GameObject {
var cost : Int!
var movementSpeed : Int!
var damage : Int!
var specials : [Special] = []
required override init() {
super.init()
}
}
class Minion : Character {
required init() {
super.init()
self.cost = 2
self.movementSpeed = 21
self.damage = 2
self.path = SKShapeNode(rectOfSize: CGSizeMake(50, 50)).path
self.fillColor = UIColor.redColor()
}
}
If I want to instantiate the MetaType of this class I can do this.
let a = Minion.self()
with no error or crash.
However... If I try to do this.
let b = Minion.self
let ax = b() << NO ERROR BUT CRASHES
I receive a BAD_ACCESS_CODE crash. This crashes as well.
let b : Minion.Type = Minion.self
let ax = b()
Anyone have any ideas?