Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Building Apple Watch Projects
  • Table Of Contents Toc
  • Feedback & Rating feedback
Building Apple Watch Projects

Building Apple Watch Projects

By : Stuart Grimshaw
close
close
Building Apple Watch Projects

Building Apple Watch Projects

By: Stuart Grimshaw

Overview of this book

With Apple’s eagerly anticipated entry into the wearable arena, the field is wide open for a new era of app development. The Apple Watch is one of the most important technologies of our time. This easy-to-understand book takes beginners on a delightful journey of discovering the features available to the developer, right up to the completion of medium-level projects ready for App Store submission. It provides the fastest way to develop real-world apps for the Apple Watch by teaching you the concepts of Watch UI, visual haptic and audio, message and data exchange between watch and phone, Web communication, and finally Visual, haptic as well as audio feedback for users. By the end of this book, you will have developed at least four fully functioning apps for deployment on watchOS 2.
Table of Contents (12 chapters)
close
close
11
Index

Getting location data


Now we get to play with some new stuff.

Apple's Core Location framework provides a wealth of functionality around tracking a user's location. Although we will only scratch the surface in this app, you will see that a CLLocation object contains a set of data about the user's geo-coordinates and time-zone, speed of motion, and a time-stamp.

If we wish to access location data, we need to ask permission of the user before we can get a response to our requests to the operating system. And to do this we must first inform the system of our app's need to do so. We do this by adding an entry into the iPhone's Info.plist file.

Modifying the iPhone's Info.plist

The easiest way to do this is to Control-click the file in the project navigator and select Open As | Source Code from the contextual menu.

Note

Be careful, don't confuse this with the watch app's identically named Info.plist file!

Add the following entry to the XML text contained in the file, immediately after <dict>, on...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Building Apple Watch Projects
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon