Closed kamarshad closed 4 years ago
Hello @kamarshad,
You can use RGLDocumentReaderResults initializer, I mean initWith RGLDocumentReaderTextResult, RGLDocumentReaderGraphicResult, and other results classes, but I think it's not a good idea. Our RGLDocumentReaderResults contains a big amount of different information, which may remain unused.
I think the better way to create your own results class, which will contain the necessary for you results.
Thank you for your reply. Yes, you are right using the initializer is not a good idea. I guess passing dictionary can be a good option. I just want to prepare different variations of RGLDocumentReaderResults
class surround to RGLCheckResult
enum. But I am not able to understand how to wrap up the RGLCheckResult
in the dictionary.
Please advice.
RGLCheckResult
is NSInteger
, so if you use Swift
just get .rawValue
, if Objective C
use NSNumber
to wrap it and put to NSDictionary
Sorry I did not explain it properly. My question was what key should be used when I put in dictionary. So when I access the RGLCheckResult/CheckResult)
without any issue.
You are talking about initWithJSON
function? If yes, we don't use it in our implementation now, so I can't say that it will work properly. Meanwhile, we use "overallResult"
key in initWithJSON
initializer to set RGLCheckResult
variable
Yes, I was talking about initWithJSON
function. Thank you
Hi @syakimchik @DmitrySmolyakov @ikliashchou I am using this wonderful library for document scanning purpose. I am stuck at a place actually I want to stub the
RGLDocumentReaderResults
class with a predefined set of hard code information. This all I want to do is to write the Unit Test cases :)I tried to explore that class and found two methods (instance and class) which accept a dictionary. But I am not sure how to build that dictionary so that I could stub it.
Can you please guide me in creating the stub?
Thanks