JSONFileLoader

Simple JSON file loader.

  • Loads translations dict for specified language.

    Declaration

    Swift

    class func loadTranslations(countryCode: CountryCode, bundle: NSBundle) -> JSONDictionary

    Parameters

    countryCode

    A country code.

    bundle

    A 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

    countryCode

    A country code.

    bundle

    A 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

    fileName

    A name of a file.

    fileType

    A type of a file.

    bundle

    A 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.