<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NetworkExtension",
  "identifier" : "/documentation/NetworkExtension/NEHotspotNetwork/setPassword(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Network Extension",
      "NetworkExtension"
    ],
    "preciseIdentifier" : "c:objc(cs)NEHotspotNetwork(im)setPassword:"
  },
  "title" : "setPassword(_:)"
}
-->

# setPassword(_:)

Provide the password for a protected network.

```
func setPassword(_ password: String)
```

## Parameters

`password`

The network password.

## Discussion

The Hotspot Helper may set a password for a protected network. The password string must adhere to IEEE 802.11 guidelines appropriate for the particular security scheme.

Hotspot Helper apps use this method only in the response to the [`NEHotspotHelperCommandType.filterScanList`](/documentation/NetworkExtension/NEHotspotHelperCommandType/filterScanList) command.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)