Shay
Shay

Reputation: 2605

Convert byte array code from c to swift

I have this line in a header file at an objective c project.

static const char my_bytes[] = { -30, 10, 90}

I want to write it in swift, how can I do it?

Upvotes: 0

Views: 248

Answers (1)

Code Different
Code Different

Reputation: 93161

let my_bytes : [CChar] = [-30, 10, 90]

CChar is simply an alias for Int8. You can read more about it in Interacting with C API.

Upvotes: 2

Related Questions