When enabling direct C++ interoperability in Xcode, this simple code below
NotificationCenter.default.addObserver(self,
selector: #selector(subjectAreaDidChange(_:)),
name: .AVCaptureDeviceSubjectAreaDidChange,
object: nil)
gives me the following error
Type 'NSNotification.Name?' has no member 'AVCaptureDeviceSubjectAreaDidChange'
But if I switch C++ and Objective-C interoperability to just C / Objective-C then the code compiles without errors.
The issue seems to affect NSNotification.Name constants only from AVFoundation framework (although there maybe more).
Why do I get this error and how do I fix it?