We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have this code for os x simple app, but it does not work:
import Cocoa struct GeoFolderData { var nomeCartella:String var nomeCommittente:String? var dataCreazioneCartella:NSDate var dataModificaCartella:NSDate var isActive:Bool } extension GeoFolderData: JSONDecodable { init(object: JSONObject) throws { let decoder = JSONDecoder(object: object) nomeCartella = try decoder.decode("Nome_Cartella") nomeCommittente = try decoder.decode("Nome_Committente") dataCreazioneCartella = try decoder.decode(key: "dataCreazioneCartella") dataModificaCartella = try decoder.decode(key: "dataModificaCartella") isActive = try decoder.decode("Is_Active") } } extension GeoFolderData: JSONEncodable { func toJSON() throws -> Any { return try JSONEncoder.create({ (encoder) -> Void in try encoder.encode(nomeCartella, key: "Nome_Cartella") try encoder.encode(nomeCommittente, key: "Nome_Committente") try encoder.encode(dataCreazioneCartella, key: "Data_Creazione_Cartella") try encoder.encode(dataModificaCartella, key: "Data_Modifica_Cartella") try encoder.encode(isActive, key: "Is_Active") }) } } extension JSONDecoder { public func decode(key: String) throws -> NSDate { return try decode(String, transformer: JSONTransformer<StringToNSDate, StringToNSDate>) } }
With these errors:
Is there anyone who can help me? Thank you.
The text was updated successfully, but these errors were encountered:
Did you trying asking this question on stackoverflow.com?
Sorry, something went wrong.
No. Now, see JSON encoding and decoding with “matthewcheok/JSONCodable” on stackoverflow.com
JSON encoding and decoding with “matthewcheok/JSONCodable”
You don't seem to import JSONCodable.
JSONCodable
No branches or pull requests
I have this code for os x simple app, but it does not work:
With these errors:
Is there anyone who can help me?
Thank you.
The text was updated successfully, but these errors were encountered: