Skip to content

Latest commit

History

History
53 lines (41 loc) 路 1.08 KB

File metadata and controls

53 lines (41 loc) 路 1.08 KB

EXTENSION

Bundle

public extension Bundle

Properties

versionNumber

var versionNumber: String

Version number via - CFBundleShortVersionString

buildNumber

var buildNumber: String

Build number via - CFBundleVersion

Methods

decode(_:fromFile:withExtension:dateDecodingStrategy:keyDecodingStrategy:)

func decode<T: Decodable>(
    _ type: T.Type,
    fromFile file: String,
    withExtension `extension`: String? = nil,
    dateDecodingStrategy: JSONDecoder.DateDecodingStrategy = .deferredToDate,
    keyDecodingStrategy: JSONDecoder.KeyDecodingStrategy = .useDefaultKeys
) -> Deferred<Future<T, Error>>

Load model type from bundle resource

  • Parameters:
    • type: Type to load
    • file: File name
    • dateDecodingStrategy: date decoding strategy
    • keyDecodingStrategy: key decoding strategy
  • Returns: Future

Parameters

Name Description
type Type to load
file File name
dateDecodingStrategy date decoding strategy
keyDecodingStrategy key decoding strategy