Book Image

Learning ibeacon

By : Craig Gilchrist
Book Image

Learning ibeacon

By: Craig Gilchrist

Overview of this book

Table of Contents (16 chapters)
Learning iBeacon
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

There be treasure nearby


We will build a treasure-hunting app in this chapter. Ideally, you'll have two compatible iOS devices so that one can be the treasure and another can be the hunter. Don't worry if you have only one iOS device; the companion app can act as the treasure, and your iOS device can be the treasure.

Our app will perform both features using modal view controllers. The main view of the app will simply allow the user to choose whether the device is the treasure or the hunter. Once the user makes his or her choice, the app will open a dedicated view controller with a single role to hunt or to be hunted.

We'll call our treasure view controller LITreasureViewController and our hunter view controller LIHunterViewController.

When our app runs in treasure mode, it will simply operate as a beacon, much like we did in Chapter 3, Broadcasting Advertisements – Sending Offers, when we sent Matey's offers from our iOS device. The app gets more interesting when it is running in hunter mode...