文件 'BluetoothController.swift' 是模块 'CoreBluetooth' 的一部分;忽略导入

File 'BluetoothController.swift' is part of module 'CoreBluetooth'; ignoring import

我正在尝试创建一个使用 CoreBluetooth 的 class。当我尝试导入时,出现此错误:

为什么会这样?如果我尝试将 CoreBluetooth 导入 ViewController.swift.

,我也会收到错误消息

我没有收到其他模块的错误:

已经有一个名为 BluetoothController.swift 的文件,它是 CoreBluetooth 框架的一部分。您的项目中可能有另一个同名文件。

尝试找到该文件并重命名。

真的很搞笑。

我将我的项目命名为 CoreBluetooth。这就是导致问题的原因。

教训:不要以框架或模块命名项目!