In my swift spritekit game I want to set a custom value on a sprite I try to do this like so
p.userData?.setValue(value: \"Hello\", forKey: \"c\")
The first argument in a method does not have an external parameter name, therefore it should be
p.userData?.setValue("Hello", forKey: "c")
or better (since userData is a NSMutableDictionary and no Key-Value Coding
magic is required here):
p.userData?.setObject("Hello", forKey: "c")
Note also (as just mentioned in a comment) that you have to create the dictionary first:
p.userData = NSMutableDictionary()
p.userData?.setObject("Hello", forKey: "c")
or alternatively, assign a dictionary with your keys and values:
p.userData = ["c" : "Hello"]