-1

I am creating an app the allows you to connect to a VPN at the tap of a button. I've been experimenting with the code, and I receive an error Use of unresolved identifier 'getPasscodeNSData'. I Googled everywhere but I could not find a way to solve this. Thank you in advance, I will leave the chunk of code below.

func initVPN() {
    let manager: NEVPNManager = NEVPNManager.sharedManager()
    let p = NEVPNProtocolIPSec()

    p.username = "vpnUser"
    p.passwordReference = getPasscodeNSData("vpnPassword")
    p.serverAddress = "vpnIP"
    p.authenticationMethod = NEVPNIKEAuthenticationMethod.SharedSecret
    p.sharedSecretReference = getPasscodeNSData("vpnSharedSecret")
    p.useExtendedAuthentication = true
    p.disconnectOnSleep = false
}
rmaddy
  • 314,917
  • 42
  • 532
  • 579

1 Answers1

0

Probably you copied this code from someone. getPasscodeNSData is a function that this person wrote. You need to copy that function too.

Witterquick
  • 6,048
  • 3
  • 26
  • 50