One Logo Pool Ball
Foundation · IOS API REFERENCE

Bundle

class · SDK 27.1

class Bundle

Members (60)

get

didLoadNotification

TypeScript
static get didLoadNotification(): NSNotification_Name
Swift declaration
class let didLoadNotification: NSNotification.Name
static · iOS 4.0+

url

TypeScript
static urlForResourceWithExtensionSubdirectoryIn(name: (string) | null, ext: (string) | null, subpath: (string) | null, bundleURL: string): (string) | null
Swift declaration
class func url(forResource name: String?, withExtension ext: String?, subdirectory subpath: String?, in bundleURL: URL) -> URL?
static · iOS 4.0+

urls

TypeScript
static urlsForResourcesWithExtensionSubdirectoryIn(ext: (string) | null, subpath: (string) | null, bundleURL: string): (Array<string>) | null
Swift declaration
class func urls(forResourcesWithExtension ext: String?, subdirectory subpath: String?, in bundleURL: URL) -> [URL]?
init

init

TypeScript
static initFor(aClass: string): Bundle
Swift declaration
init(for aClass: AnyClass)
init

init

TypeScript
static initIdentifier(identifier: string): (Bundle) | null
Swift declaration
init?(identifier: String)
static

path

TypeScript
static pathForResourceOfTypeInDirectory(name: (string) | null, ext: (string) | null, bundlePath: string): (string) | null
Swift declaration
class func path(forResource name: String?, ofType ext: String?, inDirectory bundlePath: String) -> String?
static

paths

TypeScript
static pathsForResourcesOfTypeInDirectory(ext: (string) | null, bundlePath: string): Array<string>
Swift declaration
class func paths(forResourcesOfType ext: String?, inDirectory bundlePath: String) -> [String]
static

preferredLocalizations

TypeScript
static preferredLocalizationsFrom(localizationsArray: Array<string>): Array<string>
Swift declaration
class func preferredLocalizations(from localizationsArray: [String]) -> [String]
static

preferredLocalizations

TypeScript
static preferredLocalizationsFromForPreferences(localizationsArray: Array<string>, preferencesArray?: (Array<string>) | null): Array<string>
Swift declaration
class func preferredLocalizations(from localizationsArray: [String], forPreferences preferencesArray: [String]?) -> [String]
get

allBundles

TypeScript
static get allBundles(): Array<Bundle>
Swift declaration
class var allBundles: [Bundle] { get }
get

allFrameworks

TypeScript
static get allFrameworks(): Array<Bundle>
Swift declaration
class var allFrameworks: [Bundle] { get }
get

main

TypeScript
static get main(): Bundle
Swift declaration
class var main: Bundle { get }
method · iOS 4.0+

url

TypeScript
urlForAuxiliaryExecutable(executableName: string): (string) | null
Swift declaration
func url(forAuxiliaryExecutable executableName: String) -> URL?
method · iOS 4.0+

url

TypeScript
urlForResourceWithExtension(name?: (string) | null, ext?: (string) | null): (string) | null
Swift declaration
func url(forResource name: String?, withExtension ext: String?) -> URL?
method · iOS 4.0+

url

TypeScript
urlForResourceWithExtensionSubdirectory(name?: (string) | null, ext?: (string) | null, subpath?: (string) | null): (string) | null
Swift declaration
func url(forResource name: String?, withExtension ext: String?, subdirectory subpath: String?) -> URL?
method · iOS 4.0+

url

TypeScript
urlForResourceWithExtensionSubdirectoryLocalization(name?: (string) | null, ext?: (string) | null, subpath?: (string) | null, localizationName?: (string) | null): (string) | null
Swift declaration
func url(forResource name: String?, withExtension ext: String?, subdirectory subpath: String?, localization localizationName: String?) -> URL?
method · iOS 4.0+

urls

TypeScript
urlsForResourcesWithExtensionSubdirectory(ext?: (string) | null, subpath?: (string) | null): (Array<string>) | null
Swift declaration
func urls(forResourcesWithExtension ext: String?, subdirectory subpath: String?) -> [URL]?
method · iOS 4.0+

urls

TypeScript
urlsForResourcesWithExtensionSubdirectoryLocalization(ext?: (string) | null, subpath?: (string) | null, localizationName?: (string) | null): (Array<string>) | null
Swift declaration
func urls(forResourcesWithExtension ext: String?, subdirectory subpath: String?, localization localizationName: String?) -> [URL]?
method

classNamed

TypeScript
classNamed(className: string): (string) | null
Swift declaration
func classNamed(_ className: String) -> AnyClass?
init

init

TypeScript
static initPath(path: string): (Bundle) | null
Swift declaration
init?(path: String)
init · iOS 4.0+

init

TypeScript
static initUrl(url: string): (Bundle) | null
Swift declaration
convenience init?(url: URL)
method

load

TypeScript
load(): boolean
Swift declaration
func load() -> Bool
method · iOS 2.0+

loadAndReturnError

TypeScript
loadAndReturnError(): void
Swift declaration
func loadAndReturnError() throws
method

localizedString

TypeScript
localizedStringForKeyValueTable(key: string, value?: (string) | null, tableName?: (string) | null): string
Swift declaration
func localizedString(forKey key: String, value: String?, table tableName: String?) -> String
method

object

TypeScript
object(key: string): (unknown) | null
Swift declaration
func object(forInfoDictionaryKey key: String) -> Any?
method

path

TypeScript
pathForAuxiliaryExecutable(executableName: string): (string) | null
Swift declaration
func path(forAuxiliaryExecutable executableName: String) -> String?
method

path

TypeScript
pathForResourceOfType(name?: (string) | null, ext?: (string) | null): (string) | null
Swift declaration
func path(forResource name: String?, ofType ext: String?) -> String?
method

path

TypeScript
pathForResourceOfTypeInDirectory31038(name?: (string) | null, ext?: (string) | null, subpath?: (string) | null): (string) | null
Swift declaration
func path(forResource name: String?, ofType ext: String?, inDirectory subpath: String?) -> String?
method

path

TypeScript
pathForResourceOfTypeInDirectoryForLocalization(name?: (string) | null, ext?: (string) | null, subpath?: (string) | null, localizationName?: (string) | null): (string) | null
Swift declaration
func path(forResource name: String?, ofType ext: String?, inDirectory subpath: String?, forLocalization localizationName: String?) -> String?
method

paths

TypeScript
pathsForResourcesOfTypeInDirectory45124(ext?: (string) | null, subpath?: (string) | null): Array<string>
Swift declaration
func paths(forResourcesOfType ext: String?, inDirectory subpath: String?) -> [String]
method

paths

TypeScript
pathsForResourcesOfTypeInDirectoryForLocalization(ext?: (string) | null, subpath?: (string) | null, localizationName?: (string) | null): Array<string>
Swift declaration
func paths(forResourcesOfType ext: String?, inDirectory subpath: String?, forLocalization localizationName: String?) -> [String]
method · iOS 2.0+

preflight

TypeScript
preflight(): void
Swift declaration
func preflight() throws
method · iOS 9.0+ · Deprecated in iOS 27.0

preservationPriority

TypeScript
preservationPriority(tag: string): number
Swift declaration
func preservationPriority(forTag tag: String) -> Double
method · iOS 9.0+ · Deprecated in iOS 27.0

setPreservationPriority

TypeScript
setPreservationPriority(priority: number, tags: Array<string>): void
Swift declaration
func setPreservationPriority(_ priority: Double, forTags tags: Set<String>)
method

unload

TypeScript
unload(): boolean
Swift declaration
func unload() -> Bool
get · iOS 7.0+ · Deprecated in iOS 18.0

appStoreReceiptURL

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

builtInPlugInsPath

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

builtInPlugInsURL

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

bundleIdentifier

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

bundlePath

TypeScript
get bundlePath(): string
Swift declaration
var bundlePath: String { get }
get · iOS 4.0+

bundleURL

TypeScript
get bundleURL(): string
Swift declaration
var bundleURL: URL { get }
get

developmentLocalization

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

executableArchitectures

TypeScript
get executableArchitectures(): (Array<NSNumber>) | null
Swift declaration
var executableArchitectures: [NSNumber]? { get }
get

executablePath

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

executableURL

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

infoDictionary

TypeScript
get infoDictionary(): (Record<string, unknown>) | null
Swift declaration
var infoDictionary: [String : Any]? { get }
get

isLoaded

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

localizations

TypeScript
get localizations(): Array<string>
Swift declaration
var localizations: [String] { get }
get

localizedInfoDictionary

TypeScript
get localizedInfoDictionary(): (Record<string, unknown>) | null
Swift declaration
var localizedInfoDictionary: [String : Any]? { get }
get

preferredLocalizations

TypeScript
get preferredLocalizations(): Array<string>
Swift declaration
var preferredLocalizations: [String] { get }
get

principalClass

TypeScript
get principalClass(): (string) | null
Swift declaration
var principalClass: AnyClass? { get }
get

privateFrameworksPath

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

privateFrameworksURL

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

resourcePath

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

resourceURL

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

sharedFrameworksPath

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

sharedFrameworksURL

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

sharedSupportPath

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

sharedSupportURL

TypeScript
get sharedSupportURL(): (string) | null
Swift declaration
var sharedSupportURL: URL? { get }
method · iOS 18.4+

localizedString

TypeScript
localizedStringForKeyValueTableLocalizations(key: string, value: (string) | null, tableName: (string) | null, localizations: Array<Locale_Language>): string
Swift declaration
func localizedString(forKey key: String, value: String?, table tableName: String?, localizations: [Locale.Language]) -> String

Look up a localized string given a list of available languages. - Parameters: - key: The key for the localized string to retrieve. - value: A default value to return if a localized string for ``key`` cannot be found. - tableName: The name of the strings file to search. If `nil`, the method uses tables in `Localizable.strings`. - localizations: An array of `Locale.Language` corresponding to available localizations. Bundle compares the array against its available localizations, and uses the best result to retrieve the localized string. If empty, we treat it as no localization is available, and may return a fallback. - Returns: A localized version of the string designated by ``key`` in table ``tableName``.

Skipped declarations

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

Bundle.init()

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

All Foundation types →