I was trying this last night in various combinations. To my sane mind, this should work perfectly reasonably:
var aTest: Array<AnyObject.Type> = [MyObject.Type]
As should this:
var myTest: AnyObject.Type = MyObject.Type
As for that second example, which is a little simpler, I first get the error:
Expected member name or constructor after type name
And the suggestion to change it to:
var myTest: AnyObject.Type = MyObject.Type()
Which then simply gives the dead-end error of:
'MyObject.Type' is not constructible with '()'
My MyObject is simply set up like so:
class MyObject {
}
My goal is to subclass MyObject into various different subclasses, all which will be contained within an array, so I could access their class methods and then create an instance of any of them when I choose to.
AnyObject.Typeis better known asAnyClass