I really found a difficult workaround if you already found some other open source project that uses CBCentralManagerDelegate. (And itβs easy to find some open source projects that use CBCentralManagerDelegate)
Assume that in an open source project, "ViewController.swift" uses CBCentralManagerDelegate. In your project you will need "TESTViewController.swift" to use the CBCentralManagerDelegate.
Now all you have to do is
Step 1, copy (i.e. drag) ViewController.swift (which is from an open source project) into your project
Step 2, delete all the rows in ViewController.swift that were just dragged into your project.
Step 3. If necessary, rename it from ViewController.swift to TESTViewController.swift and rename the class name as well.
Step 4 Now you can write your own code "class TESTViewController: UIViewController, CBCentralManagerDelegate {...}"
Yes, it can be stupid, but it is very useful for my project.
source share