I'm a recent Swift learner and now I'm trying to use following package: https://github.com/aaronSig/Hunspell-iOS
The package itself is written using C++ and has some headers for Objective-C. I've added *-Bridging-Header.h
file and have been able to use the package inside Swift code, but now I don't understand how to use it properly:
The comments for Objective-C headers for the library say following:
/* suggest(suggestions, word) - search suggestions
* input: pointer to an array of strings pointer and the (bad) word
* array of strings pointer (here *slst) may not be initialized
* output: number of suggestions in string array, and suggestions in
* a newly allocated array of strings (*slts will be NULL when number
* of suggestion equals 0.)
*/
LIBHUNSPELL_DLL_EXPORTED int Hunspell_suggest(Hunhandle *pHunspell, char*** slst, const char * word);
But I don't know how to get correct pointer now. I've tried to utilize answers from here: How to pass an array of Swift strings to a C function taking a char ** parameter
But this is where I got so far