In the code below I have a ViewController
(\"SenderViewController\"), which passes a message to the main ViewController
when a button is tapped. Wha
Objects don't exactly listen for method calls. They sit there, waiting to invoked.
The line
self.delegate?.messageData(inputMessage.text!)
From your SenderViewController
is a function call. (The term method and function are pretty much interchangeable, although the method
is usually used for the functions of objects.) It invokes the function messageData in ViewController
.