How to list all Bluetooth devices on macOS

I am making a macOS app that can pair and unpair Bluetooth devices without a mouse or keyboard and I need a way to list all the Bluetooth devices (Best if I could do it right from the ViewController.Swift file). I am new to programming and macOS development. I have done some iOS app development but not macOS. I am using Xcode 11 Beta on macOS 10.15 public beta. I have tried searching Google and not found anything.