I am trying to use this code that I got from
https://github.com/Intermark/Buoy/tree/master/Buoy/Swift
I am getting the following error in BUOYListener.swift and enter code here
BUOYBeacon.swift
Any idea as how to fix this?
Starting with Swift 2.0, the Swift compiler requires the method signature to strictly match that of the protocol you're implementing. In this case, that's CLLocationManagerDelegate and CBPeripheralManagerDelegate.
The correct Swift signature for didRangeBeacons is:
func locationManager(manager: CLLocationManager, didRangeBeacons beacons: [CLBeacon], inRegion region: CLBeaconRegion)
For peripheralManagerDidUpdateState:
func peripheralManagerDidUpdateState(peripheral: CBPeripheralManager)
Finally, startAdvertising requires a [String: AnyObject]
dictionary, but you're casting your peripheralData to [NSObject: AnyObject]
. Use the following cast instead:
self.beaconRegion.peripheralDataWithMeasuredPower(nil) as! [String: AnyObject]