The raw data does exist in your AVMetadataMachineReadableCodeObject
, but it's not available through a public getter.
However, you can use KVO to extract it, but Apple might reject your app. Also, future iOS versions might change their private APIs and your code could become invalid (because of the hardcoded private keys).
Swift:
readableCodeObject.valueForKeyPath("_internal.basicDescriptor")!["BarcodeRawData"]
Objective-C
[readableCodeObject valueForKeyPath:@"_internal.basicDescriptor"][@"BarcodeRawData"];
I tested this for iOS 8 and 9.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…