NSBundle instance that has the specified bundle identifier.
- iOS 2.0+
- macOS 10.0+
- tvOS 9.0+
- watchOS 2.0+
- Mac Catalyst 13.0+Beta
The identifier for an existing
NSBundle object with the bundle identifier
nil if the requested bundle is not found on the system.
This method creates and returns a new
NSBundle object if there is no existing bundle associated with
identifier. Otherwise, the existing instance is returned.
This method is typically used by frameworks and plug-ins to locate their own bundle at runtime. This method may be somewhat more efficient than trying to locate the bundle using the
init(for:) method. However, if the initial lookup of an already loaded and cached bundle with the specified identifier fails, this method uses potentially time-consuming heuristics to attempt to locate the bundle. As an optimization, you can use the
bundle method instead to avoid file system traversal.