with Class to NSKeyedArchiver.archivedDataWithRootObject

import Foundation
import UIKit

class ListaddOrder : NSObject, NSCoding {
var _id: String = ""
var id: String {
return _id
}

var _count: Int = 0
var count:Int {
return _count
}

var _image: String = ""
var image: String{

return _image
}

var _price: Int = 0
var price: Int {
return _price
}

var _name: String = ""
var name:String {
return _name
}

var _options: Dictionary = Dictionary()
var options:Dictionary {
return _options
}

var _nameOV: Dictionary = Dictionary()
var nameOV:Dictionary {
return _nameOV
}

var _description: String = ""
var desription: String {
return _description
}
init(id: String, count: Int, image: String, price: Int, name: String, options:Dictionary, nameOV:Dictionary, description: String) {
super.init()
self._id = id
self._count = count
self._image = image
self._price = price
self._name = name
self._options = options
self._nameOV = nameOV
self._description = description

}

convenience required init?(coder aDecoder: NSCoder) {
guard
let id = aDecoder.decodeObjectForKey("id") as? String,
let count = aDecoder.decodeObjectForKey("count") as? Int,
let image = aDecoder.decodeObjectForKey("image") as? String,
let price = aDecoder.decodeObjectForKey("price") as? Int,
let name = aDecoder.decodeObjectForKey("name") as? String,
let options = aDecoder.decodeObjectForKey("options") as? Dictionary,
let nameOV = aDecoder.decodeObjectForKey("nameOV") as? Dictionary,
let desription = aDecoder.decodeObjectForKey("desription") as? String
else {
return nil
}
self.init(id: id, count: count, image: image, price: price, name: name, options: options, nameOV: nameOV, description: desription)
}

func encodeWithCoder(aCoder: NSCoder) {
aCoder.encodeObject(id, forKey: "id")
aCoder.encodeObject(count, forKey: "count")
aCoder.encodeObject(image, forKey: "image")
aCoder.encodeObject(price, forKey: "price")
aCoder.encodeObject(name, forKey: "name")
aCoder.encodeObject(options, forKey: "options")
aCoder.encodeObject(name, forKey: "name")
aCoder.encodeObject(nameOV, forKey: "nameOV")
aCoder.encodeObject(desription, forKey: "desription")
}

deinit {
print("this class is deinit")
}

}