Introduction
Interface Builder (IB) is a WYSIWYG (What You See Is What You Get) editor for creating user interfaces. A drag-and-drop interface is used to add GUI components such as buttons, labels, and images. These controls are then "wired" to the source code of your view controller. The editor generates a file that you may load at runtime to recreate the user interface you've created.
When dealing with Auto Layout, IB comes in handy a lot. It can check layouts right away and tell you if a view has any confusing constraints. When working programmatically, this eliminates some trial-and-error.
The two types of files that are created from IB are: .xib and .storyboard.
Whereas, Storyboards are a more recent innovation than xibs. Storyboards are visual representations of full screens and user flows. You might be able to perform similar things with a xib (with some heavy lifting), but storyboards have additional features because they understand how view controllers and navigation work together.
Concepts
Outlets
You designate specific characteristics as outlets in your objects. They're just placeholders for now. When you load a xib/storyboard, the objects you've wired up in the xib/storyboard will be filled in.
Prefix a property with @IBOutlet to create an outlet. The editor will then have access to it.
Because the value may be nil until the xib/storyboard is loaded, the property is marked as an implicitly unwrapped optional.
The "IB" in IBOutlet refers to Interface Builder, but you'll see it in Storyboards as well because they serve the same purpose.
Actions
Methods can be marked as actions in your code. Then, in your xib/storyboard, you can connect controllers to trigger them.
@IBAction func tappedNext(sender: AnyObject) {
NSLog("Tapped next")
}
IBAction, like IBOUlet, may be found in Storyboards.
File's Owner
If you need to do any further setup after the view has been loaded from the file, don't do it in your initializer; there's no guarantee that all of the views in your file have been instanced yet. Implement the awakeFromNib on the File's Owner instead.
Scenes and Segues
A scene is a name given to each screen in a storyboard. A storyboard will frequently include numerous scenes that depict a user flow. You might have a Signup.storyboard, for example, that covers the four screens that make up your signup flow.
A segue is a transition from one screen to the next. You may either connect it to your storyboard or use the performSegueWithIdentifier function.
func userDidTapOnNextButton(sender: AnyObject) {
self.performSegueWithIdentifier("NameOfSegue", sender:self)
}






