devxoul / Then

✨ Super sweet syntactic sugar for Swift initializers
MIT License
4.19k stars 291 forks source link

Add extension for JSONDecoder and JSONEncoder #93

Closed JK0369 closed 2 years ago

JK0369 commented 2 years ago

Add extension for JSONDecoder and JSONEncoder,

to use Then for JSONDecoder & JSONEncoder like below.

let decoder = JSONDecoder().then {
  $0.keyDecodingStrategy = .convertFromSnakeCase
}