Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
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
 Costa Costa
Author Profile Icon Costa
Costa
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Swift 2 Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
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

Charts on the storyboard


Now, we can design the graphical part of this view controller. Click on the storyboard and go to the view controller that is connected to the button with the title Your Progress. Open its Identity Inspector (command + option + 3) and change its class to WeeklyChartsViewController.

Drag three labels, three views and one button to the current view. Set the first label title to Number of Steps, the second one to Heart Rates, the third one to Weight, and the button to Close. Under each label, place UIView and change their class to LineChartView:

Connect the button to its corresponding method to close the scene and connect each UIView to its corresponding chart attribute. Move and resize them till you get a layout similar to the following screenshot. Don't forget to add the auto layout constraints.

Tip

If you have any problem placing the charts on the storyboard, because they have the same color as the scene background, just temporarily change their background till you reach...

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 $15.99/month. Cancel anytime
Visually different images