ViewController talks to View by using Outlet. Any object (UILabel, UIButton, UIImage, UIView etc) in View can have an Outlet connection to ViewController. Outlet is used as
@property in ViewController which means that:
– you can set something (like Update UILabel's text, Set background image of a UIView etc.) of an object by using outlet.
– you can get something from an object (like current value of UIStepper, current font size of a NSAttributedString etc.)
View pass on messages about view to ViewController by using Action (Or in technical terms ViewController set itself as
Target for any
Action in View). Action is a
Method in ViewController (unlike Outlet which is
@property in ViewController). Whenever something (any
Event) happens to an object (like UIbutton is tapped) then Action pass on message to ViewController. Action (or Action method) can do something after receiving the message.
Note: Action can be set only by UIControl's child object; means you can't set Action for UILabel, UIView etc.