let temp = printer.information?.reserved["accessory"];
print(temp)
Output:
Optional(Optional(<EAAccessory: 0x281d04db0> {
connected:YES
connectionID:40870953
name: TSP100
manufacturer: Star Micronics
modelNumber: TTRDFGIBI GY
serialNumber: 07657643f
ppid: (null)
regioncode: (null)
firmwareRevisionActive: 1.0.0
firmwareRevisionPending: (null)
hardwareRevision: 1.0.0
dockType:
certSerial: 15 bytes
certData: 908 bytes
protocols: (
"jp.star-m.starpro"
)
delegate: (null)
}))
The type of the above printed object is Any.
Not sure how to get the value of name from the above object.
Since you are getting an
EAAAccessoryobject you can access thenameproperty. Something like this: