Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Swift 2 Blueprints

You're reading from   Swift 2 Blueprints Swift Blueprints

Arrow left icon
Product type Paperback
Published in Oct 2015
Publisher Packt
ISBN-13 9781783980765
Length 276 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Cecil Costa Cecil Costa
Author Profile Icon Cecil Costa
Cecil Costa
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. Exploring Xcode FREE CHAPTER 2. Creating a City Information App with Customized Table Views 3. Creating a Photo Sharing App 4. Simulating Home Automation with HomeKit 5. Health Analyzing App Using HealthKit 6. Creating a Game App Using SpriteKit 7. Creating an Apple Watch App 8. AVFoundation Index

The iOS app


As it was mentioned before, this app will also be developed for iOS. The iOS app has two options:

  • The first one is to add supplies to your fridge

  • The second one is to check its current state

Inside the current state option, there will be another scene that will show us a map with the directions to the supermarket.

Rename the ViewController.swift file to InitialViewController.swift. Then, click on it and also rename its class to InitialViewController. Now, click on the storyboard and update the view controller class.

Drag one label and two buttons to the scene. Set the label title to Fridge Control, one button title to Add supplies, and the other one to Check Status. Don't forget to add the auto layout constraints that you think are necessary. The final result should be a simple layout similar to the following screenshot:

Go to its Swift file and add a method that will allow the other scenes to unwind to the main scene, which is a concept we've already seen in the previous chapters...

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 £16.99/month. Cancel anytime