metatext/Shared/Networking/MastodonDecoder.swift
2020-07-31 00:13:54 -07:00

15 lines
375 B
Swift

// Copyright © 2020 Metabolist. All rights reserved.
import Foundation
class MastodonDecoder: JSONDecoder {
override init() {
super.init()
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = MastodonAPI.dateFormat
dateDecodingStrategy = .formatted(dateFormatter)
keyDecodingStrategy = .convertFromSnakeCase
}
}