Reader small image

You're reading from  Building Apple Watch Projects

Product typeBook
Published inFeb 2016
Reading LevelIntermediate
PublisherPackt
ISBN-139781785887369
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Stuart Grimshaw
Stuart Grimshaw
author image
Stuart Grimshaw

Stuart Grimshaw has programmed for Apple computers since the days before OS X and has been involved with developing for the Apple Watch since its release. Born in the UK and having lived in Germany and the Netherlands, he is currently a Senior iOS developer in London, England, United Kingdom. He has around 10 years of end-to-end development of projects experience in, iOS, iPadOS, watchOS (Apple Watch), tvOS (AppleTV), and macOS. He is passionate about the potential of the Apple Watch and Apple TV, as well as Apple's Swift programming language, and is a keen proponent of beach coding.
Read more about Stuart Grimshaw

Right arrow

Setting up the project


Set up a new project using the iOS App with WatchKit App template that we have used before, but this time include the Glance Scene (and deselect Notification Scene as previously), as pictured here:

Requirements

Using the flow diagram to provide some (very welcome) visual support, we can now start to think about our requirements in more concrete terms.

Weather data structure

Since we'll be passing a number of weather summaries to the table view that displays the initial view of the data, it makes sense to be able to package the data necessary for each individual summary into some sort of structure.

Create a new Swift file, call it WeatherData.swift, and select both the WatchKit app and the iOS app targets, as pictured here:

Note

Why do we select the phone app target when we are writing an app that will function exclusively on the watch? Well, this is simply some prudent future-proofing of the app. It seems likely that we will expand the app at some point in the future to provide...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Building Apple Watch Projects
Published in: Feb 2016Publisher: PacktISBN-13: 9781785887369

Author (1)

author image
Stuart Grimshaw

Stuart Grimshaw has programmed for Apple computers since the days before OS X and has been involved with developing for the Apple Watch since its release. Born in the UK and having lived in Germany and the Netherlands, he is currently a Senior iOS developer in London, England, United Kingdom. He has around 10 years of end-to-end development of projects experience in, iOS, iPadOS, watchOS (Apple Watch), tvOS (AppleTV), and macOS. He is passionate about the potential of the Apple Watch and Apple TV, as well as Apple's Swift programming language, and is a keen proponent of beach coding.
Read more about Stuart Grimshaw