In iOS programming, IBOutlets are very commonly used. This post will explain what IBOutlets are.
IBOutlets connect your code to your UI Elements. Each UI Element must be connected to an IBOutlet in order for the code to be able to control its attributes. Adding an IBOutlet is very simple.
The first step is to click on the button in the top right corner. The button looks like the image below.
![](https://xalting.com/wp-content/uploads/2019/12/Screen-Shot-2019-12-29-at-1.04.55-PM.png)
Now, from the file viewer on the left, click you viewcontroller’s file. Make sure your view controller in the storyboard is connected to your view controller swift file. You can check this by clicking on the View Controller in the storyboard, clicking on the newspaper icon* in the pane to the right, and making sure the class is the file desired.
![](https://xalting.com/wp-content/uploads/2019/12/Screen-Shot-2019-12-29-at-1.11.01-PM.png)
Lastly, control+click (or right click) and drag your UI Element (uilabel, uitextfield, uitextview, etc.) to just below the class declaration in your viewcontroller file. Now let go, give your IBOutlet a name and hit enter or click the button. The IBOutlet has been successfully added.
![](https://xalting.com/wp-content/uploads/2019/12/Screen-Shot-2019-12-29-at-1.17.05-PM.png)
A post about IBActions will be released soon.