small medium large xlarge

Build Location-Based Projects for iOS: GPS, Sensors, and Maps


Cover image for Build Location-Based Projects for iOS

Build Location-Based Projects for iOS

GPS, Sensors, and Maps


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.

Choose Your Format(s)

  • $18.95 In Stock
    • Beta: What do I get?

  • Ebooks are DRM free.

  • Ebook delivery options.

About this Title

Pages: 120 (est)
Published: 2020-09-10
Release: B3.0 (2020-05-29)
ISBN: 978-1-68050-781-2

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 surrounding. 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.

What You Need

You need Xcode 11 and and iPhone with iOS 13.

Contents & Extracts

This book is currently in beta, so the contents and extracts will change as the book is developed.

  • Introduction
    • Who This Book Is For
    • What Is Covered
    • How to Read This Book
    • Creating with Swift
    • Online Resources
  • Debugging on the Go
    • Creating a Host Application
    • Creating the LogStore
    • Creating a Swift Package
    • Presenting the Log On Screen
    • Presenting the Log from a Special Shake
    • Wrapping Up
    • Exercises
  • Drawing on Maps
    • Creating the Xcode Project
    • Removing the Storyboard
    • Managing Location Services
    • Building the User Interface
    • Exercises
  • Measuring Length with Gravitation
    • Collecting Motion Data
    • Storing Acceleration Data
    • Building the User Interface Using a Storyboard
    • Drawing Data
    • Starting and Stopping Motion Events
    • Three Axes of Motion
    • Adding Movable Markers to the Diagrams
    • Calculating the Length from the Swing Period
    • Exercises
  • Automating with Geofences
    • Setting Up the Xcode Project
    • Asking for Permission
    • Fetching the Current Location
    • Setting a Geofence
    • Persisting Geofence Events
    • Calculating the Outside Duration
    • Binding Data Arrays Using Combine
    • Presenting a Single Day Entry
    • Making The Day Entry Accessible
    • Combining Day Entry Views for a Week Overview
    • Exercises
  • Sharing Augmented Reality
    • Setting Up an Augmented Reality App
    • Adding Our Logging Library
    • Getting and Managing Location Updates
    • Implementing the Distance Screen
    • Adding Virtual Text to Reality
    • Storing the World Map
    • Presenting the Augmented Reality View
    • Restoring the World Map
    • Exercises
  • Sharing the Package on Github


Dominik Hauser has been developing iOS apps for more than 10 years. During this time he wrote several books about iOS development and gave talks at several conferences. He has a PhD in high-energy astrophysics from his former life as a physicist.