0%

Book Description

Coding is awesome. So is being outside. With location-based iOS apps, you can combine the two for an enhanced outdoor experience. Use Swift to create your own apps that use GPS data, read sensor data from your iPhone, draw on maps, automate with geofences, and store augmented reality world maps. You'll have a great time without even noticing that you're learning. And even better, each of the projects is designed to be extended and eventually submitted to the App Store. Explore, share, and have fun.

Location-based apps are everywhere. From mapping our jogging path to pointing us to the nearest collectible creature in a location-based game, these apps offer useful and interesting features and information related to where you are. Using real-world maps and places as the environment, they add an extra layer of adventure to exploring the outdoors. If you've ever wanted to make your own location-based apps and games, you can learn how with four simple, Swift-based projects that are easy to code and fun to use.

Build four stunning apps that sense the iPhone's surroundings. Use Core Location and MapKit to draw GPS data on maps and share the results to social media. Use the sensor data from the iPhone and draw acceleration graphs using Core Graphics while on a playground swing. Build an app that measures the time you spend outside using geofences. Combine Core Location and ARKit to build an augmented reality scavenger hunt app that you can use and play with other people. Have great time building creative apps you cannot wait to try out.

Table of Contents

  1.   Acknowledgments
  2.  Introduction
    1. Who This Book Is For
    2. Who Am I?
    3. What This Book Covers
    4. How to Read This Book
    5. Creating with Swift
    6. Online Resources
  3. 1. Drawing on Maps
    1. Creating the Xcode Project
    2. Removing the Storyboard
    3. Managing Location Services
    4. Building the User Interface
    5. Exercises
  4. 2. Measuring Length with Gravitation
    1. Setting Up the Project
    2. Collecting Motion Data
    3. Storing Acceleration Data
    4. Building the User Interface Using a Storyboard
    5. Drawing Data
    6. Starting and Stopping Motion Events
    7. Three Axes of Motion
    8. Adding Movable Markers to the Diagrams
    9. Calculating the Length from the Swing Period
    10. Exercises
  5. 3. Automating with Geofences
    1. Setting Up the Xcode Project
    2. Asking for Permission
    3. Fetching the Current Location
    4. Setting a Geofence
    5. Persisting Geofence Events
    6. Calculating the Outside Duration
    7. Binding the User Interface and Data Using Combine
    8. Presenting a Single Day Entry
    9. Making the Day Entry Accessible
    10. Combining Day Entry Views for a Week Overview
    11. Handling Wrong Authorization
    12. Things to Remember When Working with Geofences
    13. Exercises
  6. 4. Sharing Augmented Reality
    1. Setting Up an Augmented Reality App
    2. Adding Our Logging Library
    3. Getting and Managing Location Updates
    4. Implementing the Distance Screen
    5. Adding Virtual Text to Reality
    6. Storing the World Map
    7. Presenting the Augmented Reality View
    8. Restoring the World Map
    9. Exercises
  7. A1. Debugging on the Go
    1. Creating a Host Application
    2. Creating a Swift Package
    3. Creating the LogStore
    4. Presenting the Log On-Screen
    5. Presenting the Log from a Special Shake
    6. Sharing the Package on GitHub
    7. Wrapping Up
    8. Exercises
  8.  Bibliography
18.188.20.56