layout | title | description | keywords | needGenerateH3Content | needAutoGenerateSidebar | noTitleIndex |
---|---|---|---|---|---|---|
default-layout |
DSObservationParameters - Dynamsoft Core Module iOS Edition API Reference |
The class DSObservationParameters of Dynamsoft Core Module represents filter conditions for the DSIntermediateResultReceiver, which allows the user to specify which intermediate results to be notified. |
observation parameters, filter conditions, objective-c, swift |
true |
true |
true |
The DSObservationParameters
class is used to set filter conditions for the DSIntermediateResultReceiver
, so that only intermediate results meeting specific conditions will be called back.
Assembly: DynamsoftCore.framework
>- Objective-C >- Swift > >1. ```objc @interface DSObservationParameters : NSObject ``` 2. ```swift class ObservationParameters : NSObject ```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 | Type | Description |
---|---|---|
resultUnitTypesOnlyForInput |
DSIntermediateResultUnitType | Defines the type of intermediate result unit that indicates skipping default calculations and replacing with input data units. |
Adds observed task name to be notified when relevant results are available.
>- Objective-C >- Swift > >1. ```objc -(void)addObservedTask:(NSString *)taskName; ``` 2. ```swift func addObservedTask(_ taskName: String) ```Parameters
taskName
: Specify a task name to add to the observation list.
Code Snippet
>- Objective-C >- Swift > >1. ```objc [observationParameters addObservedTask:@"TextRecognition"]; ``` 2. ```swift observationParameters.addObservedTask("TextRecognition") ```Remove the observed task name so that intermediate results generated by the task are not notified.
>- Objective-C >- Swift > >1. ```objc -(void)removeObservedTask:(NSString*)taskName; ``` 2. ```swift func removeObservedTask(_ taskName: String) ```Parameters
taskName
: Specify a task name to remove from the observation list.
Code Snippet
>- Objective-C >- Swift > >1. ```objc [observationParameters removeObservedTask:@"TextRecognition"]; ``` 2. ```swift observationParameters.removeObservedTask("TextRecognition") ```Check whether the specified task was observed.
>- Objective-C >- Swift > >1. ```objc -(BOOL)isTaskObserved:(NSString*)taskName; ``` 2. ```swift 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 > >1. ```objc BOOL observed = [observationParameters isTaskObserved:@"TextRecognition"]; ``` 2. ```swift let observed = observationParameters.isTaskObserved("TextRecognition") ```Defines the type of intermediate result unit that indicates skipping default calculations and replacing with input data units.
@property (nonatomic, nullable, copy) DSIntermediateResultUnitType resultUnitTypesOnlyForInput;