Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Swift Essentials

You're reading from   Swift Essentials Get up and running lightning fast with this practical guide to building applications with Swift

Arrow left icon
Product type Paperback
Published in Dec 2014
Publisher
ISBN-13 9781784396701
Length 228 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Bandlem Limited Bandlem Limited
Author Profile Icon Bandlem Limited
Bandlem Limited
Alex Blewitt Alex Blewitt
Author Profile Icon Alex Blewitt
Alex Blewitt
Arrow right icon
View More author details
Toc

Swift and storyboards

So far in this chapter, the storyboard content does not involve any Swift or other programming content—it used the drag and drop capabilities of the storyboard editor. Fortunately, it is easy to integrate Storyboard and Swift using a custom view controller.

Custom view controllers

Each standard view controller has a corresponding superclass (listed in the Scenes and view controllers section previously in this chapter). This can be replaced with a custom subclass, which then has the ability to influence and change what happens in the user interface. To replace the message in the Message Scene, create a new file named MessageViewCotroller.swift with the following content:

import UIKit
class MessageViewController: UIViewController {
}

Having created the class, it can be associated with the view controller by selecting it in the storyboard and then switching to the identity inspector by navigating to View | Utilities | Show Identity Inspector or pressing Command + Option...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image