when should we need to implement
required init (coder aDecoder: NSCoder) {
fatal error("NSCoding not supported")
}
I am not sure when should we add this implementation besides the normal initialazation that is already exist
when should we need to implement
required init (coder aDecoder: NSCoder) {
fatal error("NSCoding not supported")
}
I am not sure when should we add this implementation besides the normal initialazation that is already exist
If your developed some code or program that you don't wanted to compile then you can use NSCoding compatible.
for e.g I had use for SpriteKit.
Required Initialisers
Required initializers can be thought of as a binding contract between a parents interface and subsequent subclasses. Its your means of enforcing that all your children are aware of and implement a certain set of initialisers.
Write the required modifier before the definition of a class initializer to indicate that every subclass of the class must implement that initializer:
In Short, we can say that in super class hierarchy any method have denoted by required then that enforced us to be implement in its subclass. so at that time need to implement it.
Click here!