I readed some nice articles, tips and answers (here), but I doesn't take this solutions and put it workable in my sourcecode :(
I need to call functions written in C provided in dylib. Without structs it works fine.
typedef struct
{
uint32_t version;
OtherType handle;
const char *pin;
const char *otherCode;
} cryptParameter;
My not working code is:
var cryptParam = cryptParameter (
version: 2,
Handle: cert,
pin: "123456",
otherCode: nil
)
The problem for me is to set the const char*
with Swift String value. The 123456
do not save in pin. (It compiles, it runs, but value isn't right 123456)
Thanks for answers!