metatext/Shared/Networking/Mastodon API/MastodonDecoder.swift

16 lines
375 B
Swift
Raw Normal View History

// 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
}
}