let encoder = JSONEncoder()
do {
let encodData = try encoder.encode("test string") // same as Int type
print(encodData) // nil
} catch let err {
print(err.localizedDescription) // The data couldn’t be written because it isn’t in the correct format.
}
如何编码这些类型值