Our application

Our app operates in two modes, as shown in the following figure. Both the treasure and hunter modes have independent view controllers to encapsulate their functionality. Our root view controller (LIViewController) simply allows us to choose the mode we want to run.

Our application

Treasure hunt app view controllers

If you don't have two iOS devices at hand, don't worry; we can use the companion app to broadcast as our treasure beacon, as shown in the following figure. Unfortunately, you can't perform Bluetooth interactions in the simulator. So, unless you have two devices, you'll only be able to test the hunter.

Using the companion app as the treasure ...

Get Learning iBeacon now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.