Skip to content

Instantly share code, notes, and snippets.

@fakiho
Created February 27, 2021 21:53
Show Gist options
  • Select an option

  • Save fakiho/3f064ec9cb61e4346b0b9e661557f516 to your computer and use it in GitHub Desktop.

Select an option

Save fakiho/3f064ec9cb61e4346b0b9e661557f516 to your computer and use it in GitHub Desktop.
extension VPNRepository {
var manager: NEVPNManager {
return NEVPNManager.shared()
}
var status: NEVPNStatus {
get {
return manager.connection.status
}
set {
registerNotification()
}
}
func registerNotification() {
NotificationCenter.default.post(name: NSNotification.Name.NEVPNStatusDidChange, object: nil, userInfo: ["status" : status])
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment