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
Post a Comment