Text Capture Deserializer#

Defined in framework ScanditTextCapture

Warning

The deserialization API is not yet stable and will still change over the coming releases.

Note

This deserializer is not thread-safe, subsequent calls for the same settings, mode or overlay have to be called on the same thread.

SDCTextCaptureDeserializer#
@interface SDCTextCaptureDeserializer : NSObject <SDCDataCaptureModeDeserializer>

Added in version 6.3.0

A deserializer to construct text capture from JSON. For most use cases it is enough to use SDCTextCapture.textCaptureFromJSONString:context:error: which internally uses this deserializer. Using the deserializer gives the advantage of being able to listen to the deserialization events as they happen and potentially influence them. Additonally warnings can be read from the deserializer that would otherwise not be available.

Related topics: Serialization.

+ textCaptureDeserializer#
+ (instancetype)textCaptureDeserializer

Added in version 6.3.0

Creates a new deserializer object.

delegate#
@property (nonatomic, weak, nullable) id<SDCTextCaptureDeserializerDelegate> delegate

Added in version 6.3.0

The object informed about deserialization events.

warnings#
@property (nonatomic, readonly) NSArray<NSString *> *warnings

Added in version 6.3.0

The warnings produced during deserialization, for example which properties were not used during deserialization.

- modeFromJSONString:withContext:error:#
- (nullable SDCTextCapture *)modeFromJSONString:(NSString *)JSONString
                                    withContext:(SDCDataCaptureContext *)context
                                          error:(NSError **)error

Added in version 6.3.0

Deserializes text capture from JSON.

An error is set if the provided JSON does not contain required properties or contains properties of the wrong type.

- updateMode:fromJSONString:error:#
- (nullable SDCTextCapture *)updateMode:(SDCTextCapture *)textCapture
                         fromJSONString:(NSString *)JSONString
                                  error:(NSError **)error

Added in version 6.3.0

Takes an existing text capture and updates it by deserializing new or changed properties from JSON. See Updating from JSON for details of how updates are being done.

An error is set if the provided JSON does not contain required properties or contains properties of the wrong type.

- settingsFromJSONString:error:#
- (nullable SDCTextCaptureSettings *)settingsFromJSONString:(NSString *)JSONString
                                                      error:(NSError **)error

Added in version 6.3.0

Deserializes text capture settings from JSON.

An error is set if the provided JSON does not contain required properties or contains properties of the wrong type.

- updateSettings:fromJSONString:error:#
- (nullable SDCTextCaptureSettings *)updateSettings:(SDCTextCaptureSettings *)settings
                                     fromJSONString:(NSString *)JSONString
                                              error:(NSError **)error

Added in version 6.3.0

Takes existing text capture settings and updates them by deserializing new or changed properties from JSON. See Updating from JSON for details of how updates are being done.

An error is set if the provided JSON does not contain required properties or contains properties of the wrong type.

- overlayFromJSONString:withMode:error:#
- (nullable SDCTextCaptureOverlay *)overlayFromJSONString:(NSString *)JSONString
                                                 withMode:(SDCTextCapture *)mode
                                                    error:(NSError **)error

Added in version 6.3.0

Deserializes a text capture overlay from JSON.

An error is set if the provided JSON does not contain required properties or contains properties of the wrong type.

- updateOverlay:fromJSONString:error:#
- (nullable SDCTextCaptureOverlay *)updateOverlay:(SDCTextCaptureOverlay *)overlay
                                   fromJSONString:(NSString *)JSONString
                                            error:(NSError **)error

Added in version 6.3.0

Takes an existing text capture overlay and updates it by deserializing new or changed properties from JSON. See Updating from JSON for details of how updates are being done.

An error is set if the provided JSON does not contain required properties or contains properties of the wrong type.