Lets say I want to do this:
class foobar : NSObject {
//method declarations, etc.
}
Then later:
let myDictionary:Dictionary = ["returnMeAnAwesomeClass":foobar]
Does not work.
If I put in foobar.Type
, it also doesn't work.
If I put in foobar.class
as foobar.Type
, it also doesn't work.
The reason I want this is because there's a method in a system API that takes a class as the argument, e.g.:
func enterState(_ stateClass: AnyClass) -> Bool
(in GKStateMachine)
I'd find it acceptable to be able to get a string and turn that into a class.