Swift Delegate (contactDelegate) explanation -


i've research lot on delegate means somehow understand doesn't fit explanation. tutorial:

    physicsworld.contactdelegate = self 

and explanation: "this sets physics world have no gravity, , sets scene delegate notified when 2 physics bodies collide."

i thought delegate class uses protocol. have different explanation this? line do? thanks. (ignore gravity part, there's line of code)

a delegate is protocol, called "delegate protocol". class containing quoted line of code becomes delegate , gets messages of protocol in question. physicsworld contact delegate inform of collision. if delegate methods implemented (i.e. controller conforms delegate protocol), can take appropriate action when notified.

clear?


Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -