Book Image

Learning Xamarin studio

By : William Smith
Book Image

Learning Xamarin studio

By: William Smith

Overview of this book

Table of Contents (16 chapters)
Learning Xamarin Studio
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Outlets and Actions


Outlets and Actions are key concepts to understand when working with Xcode and Xamarin.iOS. Defined in the class header file, these properties allow the ViewController to tie into, or interact, with the objects defined in the view. In my opinion, Outlets and Actions are most easily understood in terms of flow of communication. Simply stated, an Outlet allows your ViewController to talk to your view, while an Action allows your view to pass messages back to your ViewController.

Although the new graphical designer for iOS removes much of the headache from working with Outlets and Actions, it is still a good idea to learn how to create and manage them using Xcode to better understand how they work.

Outlets

An Outlet exposes an object in the view to the corresponding ViewController. This allows the ViewController to update property values on that object by referencing the Outlet's name. For example, the following bit of code exposes a UILabel object:

//MYViewController.h file...