Hi,
I have tried below code snippet in a playground and it crashes. Does it is compulsory to add @objc attribute to class?
class SomeClass: NSObject {
var name: String = "Test"
}
var object = SomeClass()
print(object.value(forKey: "name"))
As per Apple doc it says
Key-Value Coding with Swift
Swift objects that inherit from
NSObject or one of its subclasses are key-value coding compliant for their properties by default.Any input for same will help to clarify core concept.
Thanks in advance.