Created
February 27, 2021 21:53
-
-
Save fakiho/3f064ec9cb61e4346b0b9e661557f516 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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