Bundle
class Bundle : NSObject
-
Initialize
Bundlewith a bundle name or a bundle identifier.Declaration
Swift
public convenience init?(stringDescription: String?)Parameters
stringDescriptionBundle name or a bundle identifier.
Return Value
nilif cannot find a bundle with given name or identifier.
-
Returns array from JSON file.
Note
The file has to have a
jsonextension.Declaration
Swift
public func jsonArray<T>(with name: String) -> [T]?Parameters
nameJSON file name without extenstion.
Return Value
Array of objects, or
nilif an error occurs. -
Returns data from file.
Declaration
Swift
public func data(with name: String) -> Data?Parameters
nameFile name, with extension.
Return Value
File contents as
Dataornilif file doesn’t exists.
-
Initialize
Bundlewith a bundle name or a bundle identifier. Ifnilis passed, thenBundle.mainis returned.Declaration
Swift
public static func with(stringDescription description: String?) -> Bundle?Parameters
descriptionBundle name, a bundle identifier or
nil.Return Value
nilif cannot find a bundle with given name or identifier.Bundle.mainisnilis used as parameter.
Bundle Extension Reference