Outlet and Action Declaration and Definition

Outlet and action declaration and definition

In iPhone app development using the iOS SDK, an outlet declaration is used to connect user interface elements in a storyboard or nib file to the code in the associated view controller class. It is a property that is marked with the IBOutlet keyword, indicating that it can be accessed from the Interface Builder tool and that it represents a reference to an interface element.

On the other hand, an action declaration is used to create a method that can be triggered by user interactions with interface elements. It is marked with the IBAction keyword and specifies a particular event, such as a button press or a gesture, that will cause the method to be executed. When an action method is defined, it can be linked to a specific user interface element in the Interface Builder tool by dragging a connection from the element to the method.

Both outlet and action declarations are used to define the connection between user interface elements and the code that controls them in iOS apps. An outlet is a way of linking interface elements to properties in the view controller class, while an action is a way of linking user interface events to methods that handle them. Together, they form an essential part of the Model-View-Controller (MVC) architecture used in iOS app development.

Apply for iPhone Apps Certification Now!!

http://www.vskills.in/certification/Certified-iPhone-Apps-Developer

Back to Tutorial

Share this post
[social_warfare]
Single view Application
View Controller and Connection with Outlet and Action

Get industry recognized certification – Contact us

keyboard_arrow_up