BeaconMonitorSwift 框架用来监控和排列 iBeacons。

import BeaconMonitor
import CoRelocation

class ListenVIEwController: UIViewController {

    var monitor: BeaconMonitor?

    override Func viewDidLoad() {
        super.viewDidLoad()

        monitor = BeaconMonitor(uuid: NSUUID(UUIDString: uuidTextfield.text!)!)
        monitor!.delegate = self
        monitor!.startListening()
    }
}

extension ListenViewController: BeaconMonitoRDElegate {

    @objc func receivedAllBeacons(monitor: BeaconMonitor, beacons: [CLBeacon]) {
        print("All Beacons: \(beacons)")
    }

    @objc func receivedMatchingBeacons(monitor: BeaconMonitor, beacons: [CLBeacon]) {
        print("Matching Beacons: \(beacons)")
    }

}

 


Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务