JSONFileLoader
Simple JSON file loader.
-
Loads translations dict for specified language.
Declaration
Swift
class func loadTranslations(countryCode: CountryCode, bundle: NSBundle) -> JSONDictionaryParameters
countryCodeA country code.
bundleA bundle when file is located.
Return Value
Returns json of file or empty dictionary if cannot load a file.
-
Loads expressions dict for specified language.
Declaration
Swift
class func loadExpressions(countryCode: CountryCode, bundle: NSBundle) -> Dictionary<String, String>Parameters
countryCodeA country code.
bundleA bundle when file is located.
Return Value
dictionary with expressions or empty dictionary if cannot load a file.
-
Loads content of a file with specified name, type and bundle.
Declaration
Swift
private class func load(fileName: String, bundle: NSBundle) -> JSONDictionary?Parameters
fileNameA name of a file.
fileTypeA type of a file.
bundleA bundle when file is located.
Return Value
JSON or nil if file cannot be loaded.
-
Loads file for specified URL and try to serialize it.
Declaration
Swift
private class func load(fileURL: NSURL) -> JSONDictionary?Return Value
Dictionary with content of JSON file or nil if file cannot be loaded.
View on GitHub
JSONFileLoader Class Reference