Api v2
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
extension KeyedDecodingContainer {
|
||||
public func decodeFloatOrString(forKey key: Key) throws -> Float? {
|
||||
if let floatVal = try? decode(Float.self, forKey: key) {
|
||||
return floatVal
|
||||
}
|
||||
if let stringVal = try? decode(String.self, forKey: key) {
|
||||
return Float(stringVal)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user