I'm trying to build a tiny macOS App with Swift. Now I have some trouble on how to determine when a headphone or bluetooth headset is plugged in or connected to a Mac.
Any suggestions would be appreciated.
Update: I found an answer (posted as bellowing), but it's written with Objective-C. Anyone can help to convert it to Swift? (I tried, but got too much errors)