mirror of
https://github.com/metabolist/metatext
synced 2024-12-25 17:22:31 +01:00
16 lines
375 B
Swift
16 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
|
||
|
}
|
||
|
}
|