Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protocol FailableDecodableType {
- associatedtype BaseType
- var baseValue: BaseType? { get }
- }
- extension FailableDecodable : FailableDecodableType {
- typealias BaseType = Base
- var baseValue: Base? { return base }
- }
- extension Array where Element: FailableDecodableType {
- func filterFailedElements() -> [Element.BaseType] {
- return compactMap({ $0.baseValue })
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement