Returns by reference the byte representation of a URL object.


func CFURLGetBytes(_ url: CFURL!, _ buffer: UnsafeMutablePointer<UInt8>!, _ bufferLength: CFIndex) -> CFIndex



The URL object to convert to a byte representation.


The buffer where you want the bytes to be placed. If the buffer is of insufficient size, returns -1 and no bytes are placed in buffer. If NULL the needed length is computed and returned. The returned bytes are the original bytes from which the URL was created (not including the base URL). If the URL was created from a string, the bytes are the bytes of the string encoded via UTF-8.


The number of bytes in buffer.

Return Value

Returns the number of bytes in buffer that were filled. If the buffer is of insufficient size, returns -1.

See Also

Getting URL Properties


Returns the base URL of a given URL if it exists.

func CFURLGetTypeID() -> CFTypeID

Returns the type identifier for the CFURL opaque type.

func CFURLResourceIsReachable(CFURL!, UnsafeMutablePointer<Unmanaged<CFError>?>!) -> Bool

Returns whether the resource pointed to by a file URL can be reached.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software