April 2017
Intermediate to advanced
316 pages
9h 33m
English
The <|? operator is used to decode an optional value at the specified key path into the requested type:
public func <|? <A: Decodable>(json: JSON, keys: [String]) -> Decoded<A?> where A == A.DecodedType { switch flatReduce(keys, initial: json, combine: decodedJSON) { case .failure: return .success(.none) case .success(let x): return A.decode(x) >>- { .success(.some($0)) } } }
Read now
Unlock full access