Learn how to compare a beacon's proximity property with the value stored to ensure proper response to a beacon's detection.
- [Narrator] In this lesson,…we're going to learn how to handle proximity detection,…so that we can determine whether or not…we should further handle a detected beacon.…The first thing that I wanna do is create a helper function,…that'll return a CL proximity, based on a string value.…If we remember the beacon dictionaries that we created,…the proximity value is a string.…While in a previous chapter…we created a function that'd give us a string value…of a CL proximity object,…we do not wanna compare string values…when working with proximity.…
We wanna compare the CL proximity objects themselves,…as these are enumerated values.…Comparing strings would always return a true statement.…So I'm gonna come over to helpers,…and under get authorization status,…I'm gonna create my new function.…The name of this function is gonna be…get proximity from string.…So in this function,…I'm gonna create a switch statement…that's gonna get the value of proximity string…and in turn,…we're gonna have cases for every possible CL proximity…
- What is iBeacon?
- Turning your iOS device into a beacon
- Discovering device locations
- Monitoring for iBeacons
- Responding to beacon discovery
- Creating a beacon-based app
Skill Level Intermediate
Programming the Internet of Things with iOSwith Michael Lehman2h 49m Intermediate
Programming iOS 9 and GamePlayKitwith Tammy Coron1h 32m Intermediate
Developing for the Apple iCloud API with iOSwith Todd Perkins1h 18m Intermediate
1. Introduction to iBeacons
2. iBeacons with iOS Devices
3. Create a Beacon-Based App
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.