DSObservationParameters
The DSObservationParameters
class is used to set filter conditions for the DSIntermediateResultReceiver
, so that only intermediate results meeting specific conditions will be called back.
Definition
Assembly: DynamsoftCore.xcframework
- Objective-C
- Swift
@interface DSObservationParameters : NSObject
class ObservationParameters : NSObject
Methods
Method | Description |
---|---|
addObservedTask |
Adds observed task name to be notified when relevant results are available. |
removeObservedTask |
Remove the observed task name so that intermediate results generated by the task are not notified. |
isTaskObserved |
Check whether the specified task was observed. |
Attributes
Attributes | Type | Description |
---|---|---|
resultUnitTypesOnlyForInput |
DSIntermediateResultUnitType | Defines the type of intermediate result unit that indicates skipping default calculations and replacing with input data units. |
addObservedTask
Adds observed task name to be notified when relevant results are available.
- Objective-C
- Swift
-(void)addObservedTask:(NSString *)taskName;
func addObservedTask(_ taskName: String)
Parameters
taskName
: Specify a task name to add to the observation list.
Code Snippet
- Objective-C
- Swift
[observationParameters addObservedTask:@"TextRecognition"];
observationParameters.addObservedTask("TextRecognition")
removeObservedTask
Remove the observed task name so that intermediate results generated by the task are not notified.
- Objective-C
- Swift
-(void)removeObservedTask:(NSString*)taskName;
func removeObservedTask(_ taskName: String)
Parameters
taskName
: Specify a task name to remove from the observation list.
Code Snippet
- Objective-C
- Swift
[observationParameters removeObservedTask:@"TextRecognition"];
observationParameters.removeObservedTask("TextRecognition")
isTaskObserved
Check whether the specified task was observed.
- Objective-C
- Swift
-(BOOL)isTaskObserved:(NSString*)taskName;
func isTaskObserved(_ taskName: String) -> Bool
Parameters
taskName
: Specify a task name to check the observation state.
Return Value
A BOOL value that indicates whether the specified task is observed.
Code Snippet
- Objective-C
- Swift
BOOL observed = [observationParameters isTaskObserved:@"TextRecognition"];
let observed = observationParameters.isTaskObserved("TextRecognition")
resultUnitTypesOnlyForInput
Defines the type of intermediate result unit that indicates skipping default calculations and replacing with input data units.
@property (nonatomic, nullable, copy) DSIntermediateResultUnitType resultUnitTypesOnlyForInput;