Bundle

extension Bundle
  • Decode a JSON file from the bundle

    Declaration

    Swift

    func decode<T: Decodable>(
        _ type: T.Type,
        from file: String,
        dateDecodingStrategy: JSONDecoder.DateDecodingStrategy = .deferredToDate,
        keyDecodingStrategy: JSONDecoder.KeyDecodingStrategy = .useDefaultKeys
    ) -> T

    Parameters

    type

    The decodable type

    file

    The fil to decode

    dateDecodingStrategy

    The optional Date Decoding Strategy

    keyDecodingStrategy

    The optional Key Decoding Strategy

    Return Value

    The decoded file

  • Get the JSON data from a file in the bundle

    Declaration

    Swift

    func json(from file: String) -> String

    Parameters

    file

    The JSON file

    Return Value

    The content of the JSON file

  • The release version number of the bundle

    Declaration

    Swift

    var releaseVersionNumber: String
  • The build version number of the bundle

    Declaration

    Swift

    var buildVersionNumber: String
  • The copyright of the bundle

    Declaration

    Swift

    var copyright: String