mirror of
https://github.com/metabolist/metatext.git
synced 2024-12-03 22:06:35 +00: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
|
||
|
}
|
||
|
}
|