One Logo Pool Ball
Foundation · IOS API REFERENCE

NSURL

class · SDK 27.1

class NSURL

Members (72)

init · iOS 8.0+

init

TypeScript
static initResolvingAliasFileAtOptions(url: string, options?: NSURL_BookmarkResolutionOptions): NSURL
Swift declaration
convenience init(resolvingAliasFileAt url: URL, options: NSURL.BookmarkResolutionOptions = []) throws
static · iOS 9.0+

absoluteURL

TypeScript
static absoluteURLWithDataRepresentationRelativeTo(data: ArrayBuffer, baseURL?: (string) | null): string
Swift declaration
class func absoluteURL(withDataRepresentation data: Data, relativeTo baseURL: URL?) -> URL
static · iOS 4.0+

bookmarkData

TypeScript
static bookmarkDataWithContentsOf(bookmarkFileURL: string): ArrayBuffer
Swift declaration
class func bookmarkData(withContentsOf bookmarkFileURL: URL) throws -> Data
static · iOS 7.0+

fileURL

TypeScript
static fileURLWithFileSystemRepresentationIsDirectoryRelativeTo(path: SDKHandle, isDir: boolean, baseURL?: (string) | null): string
Swift declaration
class func fileURL(withFileSystemRepresentation path: UnsafePointer<CChar>, isDirectory isDir: Bool, relativeTo baseURL: URL?) -> URL
static

fileURL

TypeScript
static fileURLWithPath(path: string): string
Swift declaration
class func fileURL(withPath path: String) -> URL
static · iOS 2.0+

fileURL

TypeScript
static fileURLWithPathIsDirectory(path: string, isDir: boolean): string
Swift declaration
class func fileURL(withPath path: String, isDirectory isDir: Bool) -> URL
static · iOS 9.0+

fileURL

TypeScript
static fileURLWithPathIsDirectoryRelativeTo(path: string, isDir: boolean, baseURL?: (string) | null): string
Swift declaration
class func fileURL(withPath path: String, isDirectory isDir: Bool, relativeTo baseURL: URL?) -> URL
static · iOS 9.0+

fileURL

TypeScript
static fileURLWithPathRelativeTo(path: string, baseURL?: (string) | null): string
Swift declaration
class func fileURL(withPath path: String, relativeTo baseURL: URL?) -> URL
static · iOS 4.0+

fileURL

TypeScript
static fileURLWithPathComponents(components: Array<string>): (string) | null
Swift declaration
class func fileURL(withPathComponents components: [String]) -> URL?
static · iOS 4.0+

resourceValues

TypeScript
static resourceValuesForKeysFromBookmarkData(keys: Array<URLResourceKey>, bookmarkData: ArrayBuffer): (NativeMap<URLResourceKey, unknown>) | null
Swift declaration
class func resourceValues(forKeys keys: [URLResourceKey], fromBookmarkData bookmarkData: Data) -> [URLResourceKey : Any]?
static · iOS 4.0+

writeBookmarkData

TypeScript
static writeBookmarkData(bookmarkData: ArrayBuffer, bookmarkFileURL: string, options: number): void
Swift declaration
class func writeBookmarkData(_ bookmarkData: Data, to bookmarkFileURL: URL, options: NSURL.BookmarkFileCreationOptions) throws
method · iOS 4.0+

appendingPathComponent

TypeScript
appendingPathComponent(pathComponent: string): (string) | null
Swift declaration
func appendingPathComponent(_ pathComponent: String) -> URL?
method · iOS 5.0+

appendingPathComponent

TypeScript
appendingPathComponentIsDirectory(pathComponent: string, isDirectory: boolean): (string) | null
Swift declaration
func appendingPathComponent(_ pathComponent: String, isDirectory: Bool) -> URL?
method · iOS 4.0+

appendingPathExtension

TypeScript
appendingPathExtension(pathExtension: string): (string) | null
Swift declaration
func appendingPathExtension(_ pathExtension: String) -> URL?
method · iOS 4.0+

bookmarkData

TypeScript
bookmarkDataOptionsIncludingResourceValuesForKeysRelativeTo(options?: NSURL_BookmarkCreationOptions, keys?: (Array<URLResourceKey>) | null, relativeURL?: (string) | null): ArrayBuffer
Swift declaration
func bookmarkData(options: NSURL.BookmarkCreationOptions = [], includingResourceValuesForKeys keys: [URLResourceKey]?, relativeTo relativeURL: URL?) throws -> Data
method · iOS 8.0+

checkPromisedItemIsReachableAndReturnError

TypeScript
checkPromisedItemIsReachableAndReturnError(): { $ret: boolean; $out: { "error": (NSError) | null } }
Swift declaration
func checkPromisedItemIsReachableAndReturnError(_ error: NSErrorPointer) -> Bool

Omit the output parameters from the call. The result contains $ret and $out, with error inside $out.

method · iOS 4.0+

checkResourceIsReachableAndReturnError

TypeScript
checkResourceIsReachableAndReturnError(): { $ret: boolean; $out: { "error": (NSError) | null } }
Swift declaration
func checkResourceIsReachableAndReturnError(_ error: NSErrorPointer) -> Bool

Omit the output parameters from the call. The result contains $ret and $out, with error inside $out.

method · iOS 4.0+

fileReferenceURL

TypeScript
fileReferenceURL(): (string) | null
Swift declaration
func fileReferenceURL() -> URL?
method · iOS 7.0+

getFileSystemRepresentation

TypeScript
getFileSystemRepresentation(buffer: SDKHandle, maxBufferLength: number): boolean
Swift declaration
func getFileSystemRepresentation(_ buffer: UnsafeMutablePointer<CChar>, maxLength maxBufferLength: Int) -> Bool
method · iOS 8.0+

getPromisedItemResourceValue

TypeScript
getPromisedItemResourceValue(key: URLResourceKey): { $ret: null; $out: { "value": (unknown) | null } }
Swift declaration
func getPromisedItemResourceValue(_ value: AutoreleasingUnsafeMutablePointer<AnyObject?>, forKey key: URLResourceKey) throws

Omit the output parameters from the call. The result contains $ret and $out, with value inside $out.

method · iOS 4.0+

getResourceValue

TypeScript
getResourceValue(key: URLResourceKey): { $ret: null; $out: { "value": (unknown) | null } }
Swift declaration
func getResourceValue(_ value: AutoreleasingUnsafeMutablePointer<AnyObject?>, forKey key: URLResourceKey) throws

Omit the output parameters from the call. The result contains $ret and $out, with value inside $out.

init · iOS 9.0+

init

TypeScript
static initAbsoluteURLWithDataRepresentationRelativeTo(data: ArrayBuffer, baseURL?: (string) | null): NSURL
Swift declaration
init(absoluteURLWithDataRepresentation data: Data, relativeTo baseURL: URL?)
init · iOS 4.0+

init

TypeScript
static initResolvingBookmarkDataOptionsRelativeToBookmarkDataIsStale(bookmarkData: ArrayBuffer, options?: NSURL_BookmarkResolutionOptions, relativeURL?: (string) | null): { $ret: NSURL; $out: { "isStale": boolean } }
Swift declaration
convenience init(resolvingBookmarkData bookmarkData: Data, options: NSURL.BookmarkResolutionOptions = [], relativeTo relativeURL: URL?, bookmarkDataIsStale isStale: UnsafeMutablePointer<ObjCBool>?) throws

Omit the output parameters from the call. The result contains $ret and $out, with isStale inside $out.

init · iOS 7.0+

init

TypeScript
static initFileURLWithFileSystemRepresentationIsDirectoryRelativeTo(path: SDKHandle, isDir: boolean, baseURL?: (string) | null): NSURL
Swift declaration
init(fileURLWithFileSystemRepresentation path: UnsafePointer<CChar>, isDirectory isDir: Bool, relativeTo baseURL: URL?)
init

init

TypeScript
static initFileURLWithPath(path: string): NSURL
Swift declaration
init(fileURLWithPath path: String)
init · iOS 2.0+

init

TypeScript
static initFileURLWithPathIsDirectory(path: string, isDir: boolean): NSURL
Swift declaration
init(fileURLWithPath path: String, isDirectory isDir: Bool)
init · iOS 9.0+

init

TypeScript
static initFileURLWithPathIsDirectoryRelativeTo(path: string, isDir: boolean, baseURL?: (string) | null): NSURL
Swift declaration
init(fileURLWithPath path: String, isDirectory isDir: Bool, relativeTo baseURL: URL?)
init · iOS 9.0+

init

TypeScript
static initFileURLWithPathRelativeTo(path: string, baseURL?: (string) | null): NSURL
Swift declaration
init(fileURLWithPath path: String, relativeTo baseURL: URL?)
init · iOS 9.0+

init

TypeScript
static initDataRepresentationRelativeTo(data: ArrayBuffer, baseURL?: (string) | null): NSURL
Swift declaration
init(dataRepresentation data: Data, relativeTo baseURL: URL?)
init · iOS 2.0+ · Deprecated in iOS 9.0

init

TypeScript
static initSchemeHostPath(scheme: string, host: (string) | null, path: string): (NSURL) | null
Swift declaration
convenience init?(scheme: String, host: String?, path: String)
init

init

TypeScript
static initString(URLString: string): (NSURL) | null
Swift declaration
convenience init?(string URLString: String)
init · iOS 17.0+

init

TypeScript
static initStringEncodingInvalidCharacters(URLString: string, encodingInvalidCharacters: boolean): (NSURL) | null
Swift declaration
convenience init?(string URLString: String, encodingInvalidCharacters: Bool)
init

init

TypeScript
static initStringRelativeTo(URLString: string, baseURL?: (string) | null): (NSURL) | null
Swift declaration
init?(string URLString: String, relativeTo baseURL: URL?)
method · iOS 4.0+

isFileReferenceURL

TypeScript
isFileReferenceURL(): boolean
Swift declaration
func isFileReferenceURL() -> Bool
method · iOS 8.0+

promisedItemResourceValues

TypeScript
promisedItemResourceValues(keys: Array<URLResourceKey>): NativeMap<URLResourceKey, unknown>
Swift declaration
func promisedItemResourceValues(forKeys keys: [URLResourceKey]) throws -> [URLResourceKey : Any]
method · iOS 7.0+

removeAllCachedResourceValues

TypeScript
removeAllCachedResourceValues(): void
Swift declaration
func removeAllCachedResourceValues()
method · iOS 7.0+

removeCachedResourceValue

TypeScript
removeCachedResourceValue(key: URLResourceKey): void
Swift declaration
func removeCachedResourceValue(forKey key: URLResourceKey)
method · iOS 4.0+

resourceValues

TypeScript
resourceValuesForKeys(keys: Array<URLResourceKey>): NativeMap<URLResourceKey, unknown>
Swift declaration
func resourceValues(forKeys keys: [URLResourceKey]) throws -> [URLResourceKey : Any]
method · iOS 4.0+

setResourceValue

TypeScript
setResourceValue(value: (unknown) | null, key: URLResourceKey): void
Swift declaration
func setResourceValue(_ value: Any?, forKey key: URLResourceKey) throws
method · iOS 4.0+

setResourceValues

TypeScript
setResourceValues(keyedValues: NativeMap<URLResourceKey, unknown>): void
Swift declaration
func setResourceValues(_ keyedValues: [URLResourceKey : Any]) throws
method · iOS 7.0+

setTemporaryResourceValue

TypeScript
setTemporaryResourceValue(value: (SDKHandle) | null, key: URLResourceKey): void
Swift declaration
func setTemporaryResourceValue(_ value: (any Sendable)?, forKey key: URLResourceKey)
method · iOS 8.0+

startAccessingSecurityScopedResource

TypeScript
startAccessingSecurityScopedResource(): boolean
Swift declaration
func startAccessingSecurityScopedResource() -> Bool
method · iOS 8.0+

stopAccessingSecurityScopedResource

TypeScript
stopAccessingSecurityScopedResource(): void
Swift declaration
func stopAccessingSecurityScopedResource()
get · iOS 4.0+

deletingLastPathComponent

TypeScript
get deletingLastPathComponent(): (string) | null
Swift declaration
var deletingLastPathComponent: URL? { get }
get · iOS 4.0+

deletingPathExtension

TypeScript
get deletingPathExtension(): (string) | null
Swift declaration
var deletingPathExtension: URL? { get }
get · iOS 4.0+

resolvingSymlinksInPath

TypeScript
get resolvingSymlinksInPath(): (string) | null
Swift declaration
var resolvingSymlinksInPath: URL? { get }
get · iOS 4.0+

standardizingPath

TypeScript
get standardizingPath(): (string) | null
Swift declaration
var standardizingPath: URL? { get }
get

absoluteString

TypeScript
get absoluteString(): (string) | null
Swift declaration
var absoluteString: String? { get }
get

absoluteURL

TypeScript
get absoluteURL(): (string) | null
Swift declaration
var absoluteURL: URL? { get }
get

baseURL

TypeScript
get baseURL(): (string) | null
Swift declaration
var baseURL: URL? { get }
get · iOS 9.0+

dataRepresentation

TypeScript
get dataRepresentation(): ArrayBuffer
Swift declaration
var dataRepresentation: Data { get }
get · iOS 4.0+

filePathURL

TypeScript
get filePathURL(): (string) | null
Swift declaration
var filePathURL: URL? { get }
get · iOS 7.0+

fileSystemRepresentation

TypeScript
get fileSystemRepresentation(): SDKHandle
Swift declaration
var fileSystemRepresentation: UnsafePointer<CChar> { get }
get

isFileURL

TypeScript
get isFileURL(): boolean
Swift declaration
var isFileURL: Bool { get }
get

fragment

TypeScript
get fragment(): (string) | null
Swift declaration
var fragment: String? { get }
get · iOS 9.0+

hasDirectoryPath

TypeScript
get hasDirectoryPath(): boolean
Swift declaration
var hasDirectoryPath: Bool { get }
get

host

TypeScript
get host(): (string) | null
Swift declaration
var host: String? { get }
get · iOS 4.0+

lastPathComponent

TypeScript
get lastPathComponent(): (string) | null
Swift declaration
var lastPathComponent: String? { get }
get · iOS 2.0+ · Deprecated in iOS 13.0

parameterString

TypeScript
get parameterString(): (string) | null
Swift declaration
var parameterString: String? { get }
get

password

TypeScript
get password(): (string) | null
Swift declaration
var password: String? { get }
get

path

TypeScript
get path(): (string) | null
Swift declaration
var path: String? { get }
get · iOS 4.0+

pathComponents

TypeScript
get pathComponents(): (Array<string>) | null
Swift declaration
var pathComponents: [String]? { get }
get · iOS 4.0+

pathExtension

TypeScript
get pathExtension(): (string) | null
Swift declaration
var pathExtension: String? { get }
get

port

TypeScript
get port(): (NSNumber) | null
Swift declaration
@NSCopying var port: NSNumber? { get }
get

query

TypeScript
get query(): (string) | null
Swift declaration
var query: String? { get }
get

relativePath

TypeScript
get relativePath(): (string) | null
Swift declaration
var relativePath: String? { get }
get

relativeString

TypeScript
get relativeString(): string
Swift declaration
var relativeString: String { get }
get

resourceSpecifier

TypeScript
get resourceSpecifier(): (string) | null
Swift declaration
var resourceSpecifier: String? { get }
get

scheme

TypeScript
get scheme(): (string) | null
Swift declaration
var scheme: String? { get }
get

standardized

TypeScript
get standardized(): (string) | null
Swift declaration
var standardized: URL? { get }
get

user

TypeScript
get user(): (string) | null
Swift declaration
var user: String? { get }
get · iOS 8.0+

customPlaygroundQuickLook

TypeScript
get customPlaygroundQuickLook(): SDKHandle
Swift declaration
var customPlaygroundQuickLook: PlaygroundQuickLook { get }

A custom playground Quick Look for this instance. If this type has value semantics, the `PlaygroundQuickLook` instance should be unaffected by subsequent mutations.

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

NSURL.init()

inherited init: cannot prove legal (class declares 23 custom initializers)

All Foundation types →