Skip to main content
delegate

delegate

5 8.8
In programming, an object that holds a function so it can be called later
  • noun
  • /ˈdɛlɪɡeɪt/
  • Specialized
translation icon : delegado
  • Have you ever wanted to add multiple classes as a delegate for a UI control?

Examples

  • In programming, a delegate is used to define callback methods for event handling.

  • Here is the complete implementation of these delegate methods, just in case you get a bit lost:

    Blog text (31)
  • We allocate this thing, initialize it, set the delegate to us.

  • Both UITableView and UICollectionView ask their delegates for size information about the cells they display.

    Blog text (31)
  • To make SHCTableViewDragAddNew use this delegate, open SHCTableViewDragAddNew.h and adopt the delegate protocol:

    Blog text (31)
  • The delegate for the committee provided valuable insights during the meeting.

  • To handle user interactions effectively, developers often utilize a delegate to manage event responses.

Synonyms

lambda
vsdelegate
  • Specialized
3 7.6

A small unnamed function written directly in code for short tasks

is a stored type-safe object that keeps a reference for calling later

Compounds

9.9

A person the Pope sends to represent the Vatican in a country with no official relations

9.1

A union representative who visits workplaces to check that agreements with employers are kept

Surface Forms

delegate singular
delegates plural

Etymology

In computing the word delegate keeps the same basic idea: it comes from de- and legare meaning 'away' and 'to send'. A computing delegate is like sending a small task to another method or function to do later, so the name fits because it 'sends' the work to someone else to perform.