6
In iOS programming it is common to use structures that act as delegates.
One of them, for example, is the UITextFieldDelegate
. This class, according to documentation, informs the implementor of important events of the UITextField
, how the user started typing or finished it.
I understand the use of UITextFieldDelegate
, but not what are these delegates and why they are needed.
- There is a more concrete definition?
- Is it a Pattern design? An architecture?
- Exclusive to iOS programming or implemented in other technologies?
- It is an implementation of a kind of event-oriented programming?
You can think of a delegate as a pointer
*
for a functionfun()
, he keeps a reference so that it can be invoked in the future.– gato
This comes from a doubt of Swift, Objective-C?
– Maniero
Comes from Swift.......
– vinibrsl
Can put the tag?
– Maniero