I am referring the answer here: https://stackoverflow.com/a/24061386/58129
The code is reproduced here:
var clazz: NSObject.Type = TestObject.self
var instance : NSObject = clazz()
if let testObject = instance as? TestObject {
println("yes!")
}
If I tried it in a playground in XCode6 beta6, it throws an exception:
Is it no long valid to instantiate a class by calling T.self()