GPS, Sensors, and Maps
Dominik Hauser

#iOS
#Location
#GPS
#Swift
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. Drawing on Maps
2. Measuring Length with Gravitation
3. Automating with Geofenoes
4. Sharing Augmented Reality
Learning new skills works best when it’s fun. You dive deeper and deeper. Hours pass and you can’t stop reading and experimenting. But there is also the outside world. And there is the feeling you have after a nice walk in the woods. Wouldn’t it be cool if you could combine learning about iOS development with being outside? This book features four inspiring projects you get to test outside. You will draw on a map by moving in the real world, measure the length of a swing while swinging, measure the length of time you are outside, and share augmented reality views. You will learn how to build user interfaces using the three main approaches: storyboards, code, and SwiftUI. As a bonus, each project is designed to be expanded to a real App Store app.
Who This Book Is For
This book is for developers who already have rudimentary experience with iOS development and want to learn about GPS, sensors, and ARKit. And even if you already have experience with location-based apps, the projects might give you new ideas for your own apps.
We assume that you already have Xcode installed and know the basics about its structure. If you have worked through a beginner’s book or other beginner’s resources, you are perfectly prepared to work through the projects in this book. The first three chapters, especially, cover in detail what you have to do in Xcode to follow along.
How to Read This Book
The chapters are independent from each other. But if you are a beginner in iOS development in general, you should read the book from cover to cover. The first two chapters explain in detail what to do and why to do it that way, and the last two chapters assume you’ve read, or already know, those explanations. Throughout the book we use storyboards, code, and SwiftUI to create the user interfaces of the apps. When you have finished the book you can increase your skills and maximize the learning by recreating the projects using a different approach for the user interface. Or you can even mix the projects. Build an app that combines two or three of the shown projects. Invent something new.
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.









