Xcode 6 プレイグラウンドに次のコードがあります。
import Cocoa
import IOBluetooth
class BlueDelegate : IOBluetoothDeviceInquiryDelegate {
func deviceInquiryComplete(sender: IOBluetoothDeviceInquiry, error: IOReturn, aborted: Bool) {
aborted
var devices = sender.foundDevices()
for device : AnyObject in devices {
if let thingy = device as? IOBluetoothDevice {
thingy.getAddress()
}
}
}
}
var inquiry = IOBluetoothDeviceInquiry(delegate: BlueDelegate())
inquiry.start()
OSX で Bluetooth を使い始めたばかりで、現在必要なのは範囲内のデバイスのリストだけです。
私のデリゲートメソッドをまったく呼び出していないようです。
私は OSX 開発と Swift の初心者なので、優しくしてください。:)