Skip to content

Instance Property

dataRepresentation

iOS 9.0+ iPadOS 9.0+ Mac Catalyst 9.0+ macOS 10.11+ tvOS 9.0+ watchOS 2.0+
The data representation of the URL’s relativeString.
var dataRepresentation: Data { get }

Discussion

If the URL was initialized with init?(dataRepresentation:relativeTo:isAbsolute:), the data representation returned are the same bytes as those used at initialization; otherwise, the data representation returned are the bytes of the relativeString encoded with UTF8 string encoding.