Skip to content

Instance Property

percentEncodedUser

iOS 8.0+ iPadOS 8.0+ Mac Catalyst 8.0+ macOS 10.10+ tvOS 9.0+ watchOS 2.0+
The user subcomponent, percent-encoded.
var percentEncodedUser: String? { get set }

Discussion

The getter for this property retains any percent encoding this component may have. Setting this properties assumes the component string is already correctly percent encoded. Attempting to set an incorrectly percent encoded string will cause a fatalError.

Although ‘;’ is a legal path character, it is recommended that it be percent-encoded for best compatibility with URL (String.addingPercentEncoding(withAllowedCharacters:) will percent-encode any ‘;’ characters if you pass CharacterSet.urlUserAllowed).