Learning to use User Defined Runtime Attributes

Hi,
I'm new to iOS development. I'm trying to set User Defined Runtime Attributes to a button and getting the Key path as "music.key" as String.

I then try to get the value using the code below in the ViewCOntroller.

print(sender.value(forKeyPath: "music.key")!)

I get the error
2020-10-06 12:05:11.519925+1100 Xylophone[81797:29787109] Failed to set (music.key) user defined inspected property on (UIButton): [<UIButton 0x7fe1ffc0c410> valueForUndefinedKey:]: this class is not key value coding-compliant for the key music.

What am I doing wrong? Is there a page on how to properly use User Defined Runtime Attributes?

Much Appreciated.

Thanks

Answered by KiddoLamo in 641513022
Accepted Answer
Learning to use User Defined Runtime Attributes
 
 
Q