Swifterswift: Add KeyedDecodingContainer extensions

Created on 21 Oct 2019  路  3Comments  路  Source: SwifterSwift/SwifterSwift

Add the following extensions to KeyedDecodingContainer

public extension KeyedDecodingContainer where Key: CodingKey {
    /// SwifterSwift: Try to decode a Bool as Int then String before decoding as Bool.
    ///
    /// - Parameter key: Key.
    /// - Returns: Decoded Bool value.
    /// - Throws: Decoding error.
    public func decodeBoolAsIntOrString(forKey key: K) throws -> Bool { ... }

    /// SwifterSwift: Try to decode a Bool as Int then String before decoding as Bool if present.
    ///
    /// - Parameter key: Key.
    /// - Returns: Decoded Bool value.
    /// - Throws: Decoding error.
    public func decodeBoolAsIntOrStringIfPresent(forKey key: K) throws -> Bool? { ... }
}
Hacktoberfest good first issue help wanted new extension

All 3 comments

I can take this one ;)

@FraDeliro Go for it, I assigned it to you 馃殌

Thanks @omaralbeik 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fanglinwei picture fanglinwei  路  5Comments

martinstoyanov picture martinstoyanov  路  5Comments

omaralbeik picture omaralbeik  路  3Comments

SD10 picture SD10  路  3Comments

omaralbeik picture omaralbeik  路  5Comments