Created
December 15, 2016 07:53
-
-
Save onevcat/7f42bd010b4cba02928db2eb537c9cd0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct DecodableArray<T: Decodable>: Decodable { | |
let value: [T] | |
static func parse(data: Data) -> DecodableArray<T> { | |
var value = [T]() | |
for subData in data { | |
let result = T.parse(data: data) | |
value.append(result) | |
} | |
return DecodableArray(value: value) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment