I would like to implement init(coder aDecoder: NSCoder!)
in a superclass, and use it in all subclasses by calling a class method on the particular subclass in the superclass at runtime.
MySuperClass
class func dummyDict() -> NSDictionary
init(coder aDecoder: NSCoder!) {
for(key,value) in self.class.dummyDict(){
--------------------
^
|
|
Get this from the corresponding subclass at runtime!
NSLog("encoding \(value) for key \(key)")
}
}
Is it possible that subclasses from MySuperClass
access the class function dummyDict()
at runtime ?