Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How is CommonCrypto used in SWIFT3?

The guidance is to to use #import "CommonCrypto/CommonCrypto.h" in the bridging header. This is from the question at: SHA256 in swift.
However, when I use the answers given by Andi and Graham Xcode still complains about "use of unresolved identifier CC_SHA256_DIGEST_LENGTH..."

I am thinking I've made one of two mistakes: Either (a) I am missing something in not having wired up the header and import correctly. i.e. I did not setup the bridging header correctly. I'd love clear steps on how to include the library and create the bridging header correctly. Or (b)The library is not included by default and I actually need to download it and store locally before I can use it. I'd love instructions on that.

Thanks.

like image 915
Metis Avatar asked Jul 22 '17 22:07

Metis


Video Answer


1 Answers

Good news!: Swift 4(Xcode 10) has made CommonCrypto to be available for import by default!

This may not be helpful for you at Swift 3 but still, it's just FYI

like image 110
Lokesh SN Avatar answered Nov 15 '22 09:11

Lokesh SN