YouTip LogoYouTip

Ios Action Outlet

## Introduction In iOS, actions and outlets refer to ibActions and ibOutlets β€” the connections created in Interface Builder. These are related to UI elements, and we will visually understand them before exploring how to implement them. ## Steps 1. Let's use the first iPhone application we created. 2. From the navigation pane, select the ViewController.xib file. 3. From the object library displayed in the lower-right window, choose a UI element. ![Image 11: objectLibrary](#) 4. Drag the UI element into the visual canvas of the interface builder. 5. Add a label and a red circular button to the visual area. ![Image 12: interfaceAction](#) 6. In the upper-right corner of the workspace toolbar, locate the editor selection button, as shown below: ![Image 13: StandardEditor](#) **Select the Editor Button** ![Image 14: AssistantEditor](#) 7. The editor area now displays two windows: ViewController.xib and ViewController.h. 8. Right-click on the label’s button, hold down, and drag a new reference connection, as shown below: ![Image 15: ibOutletDrag](#) 9. Now place it inside the braces of ViewController.h. You can also place it elsewhere in the file, but if so, you must have added it beforehand. As shown below: ![Image 16: ibOutletDrop](#) 10. Enter the outlet name, here given as myTitleLable. Click Link to complete the ibOutlet. 11. Similarly, add an action by right-clicking the rounded rectangle, selecting "Touch Inside," and dragging it down into the braces. ![Image 17: ActionDrag](#) 12. Rename it to setTitleLable. ![Image 18: ActionDrop](#) 13. Select the ViewController.m file. One way to do this is as follows
← Ios DelegatesIos First Iphone Application β†’