title: How to set addObserver in SwiftUI?
body: <p>How do I add <strong>NotificationCenter.default.addObserve</strong> in SwiftUI?</p>
  
  <p>When I tried adding observer I get below error</p>
  
  <blockquote>
    <p>Argument of '#selector' refers to instance method 'VPNDidChangeStatus'
    that is not exposed to Objective-C</p>
  </blockquote>
  
  <p>But when I add <strong>@objc</strong> in front of func I get below error</p>
  
  <blockquote>
    <p>@objc can only be used with members of classes, @objc protocols, and
    concrete extensions of classes</p>
  </blockquote>
  
  <p>Here is my code</p>
  
  <pre><code>let NC = NotificationCenter.default
  
  var body: some View {
       VStack() {
  
       }.onAppear {
  
             self.NC.addObserver(self, selector: #selector(self.VPNDidChangeStatus),
                                name: .NEVPNStatusDidChange, object: nil)
  
       }
  } 
  
  @objc func VPNDidChangeStatus(_ notification: Notification) {
      //    print("VPNDidChangeStatus", VPNManager.shared.status)
  }
  </code></pre>