O'Reilly logo

Xamarin Mobile Application Development for iOS by Paul F. Johnson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Events

Events are an essential aspect of any iOS application. In fact, without them, your phone will just sit there like a useless lump of plastic! Every time something happens, an event is raised. For the developer, events are everything.

In this chapter we will be covering the following topics:

  • Handling events
  • Event reference
  • Control event reference

Handling events

Events are handled using one of the following types:

  • Delegates
  • Handlers

Delegates

You can think of a delegate event as an inline event. They can be anonymous or can use the event as follows:

  • When the delegate is anonymous, the code will be as follows:
    var uiButton = new UIButton();
    uiButton.TouchUpInside += delegate {…};
  • When the delegate is using an event, the code will be as follows: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required