Using Mac os x 10.13 the network preferences pane shows status of network services (eg Wi-Fi and/or Ethernet) being connected or not. If I change the service status, say by turning Wi-Fi off or on, or disconnecting/connecting ethernet cable then the Preferences Pane reflects this change immediately which implies that it is getting some notification of the network service changes.
How can I accomplish receiving these types of notifications in my Swift program?
I know that I can create a timer object to periodically check the status using the NetworkSetup app process commands and this works fine, but I wish to be notified when the changes occur.