-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
public class ProductInput: Serializable {
@serialized
public var query: String?
required init() { }
}
//convert to data
let encoder = JSONEncoder()
let data = try! encoder.encode(ProductInput())
//print string
let jsonObject = try! JSONSerialization.jsonObject(with: data, options: [])
let dictionary = jsonObject as! [String:Any]
print(dictionary)
//result
▿ 1 elements
▿ 0 : 2 elements
- key : "query"
- value :
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels