Created
May 1, 2016 09:44
-
-
Save malcommac/99442cd17d31f325d75105a6a12d5cf9 to your computer and use it in GitHub Desktop.
Beacon Monitor with SwiftLocation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // MONITOR BEACON FAMILY | |
| let request = BeaconManager.shared.monitorForBeaconFamily(proximityUUID: familyUUID, onRangingBeacons: { beaconsFound in | |
| // beaconsFound is an array of found beacons ([CLBeacon]) | |
| }) { error in | |
| // something bad happened | |
| } | |
| // Sometimes in the future you may decide to stop observing | |
| request.stop() | |
| // MONITOR BEACON | |
| let request = BeaconManager.shared.monitorForBeacon(proximityUUID: familyUUID, major: majorID, minor: minorID, onFound: { beaconsFound in | |
| // beaconsFound is an array of found beacons ([CLBeacon]) but in this case it contains only one beacon | |
| }) { error in | |
| // something bad happened | |
| } | |
| // Sometimes in the future you may decide to stop observing | |
| request.stop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment