Unable to use IOBluetooth framework with Swift 2.2


(Matt Rajca) #1

Hello,

After installing the Swift 2.2 toolchain (and running it with Xcode 7.2), I found I am unable to compile any OS X projects that use the IOBluetooth framework. Namely, I get a “'IOBluetoothDevice' is ambiguous for type lookup in this context” error when merely trying to declare a variable of type `IOBluetoothDevice`:

import Cocoa
import IOBluetooth

@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
  @IBOutlet weak var window: NSWindow!
  
  var device: IOBluetoothDevice?

···

~~~~~~~~~~~~~~~~~~~~~~~~
}

This is a regression from Swift 2.1 and reproduces in a clean project with no other frameworks or source files beyond what’s in the code snippet above.

It’d be great if someone could look at this: https://bugs.swift.org/browse/SR-545

Thanks,

— Matt