Conditionally use CryptoKit

Normally, what you'd do is hit the plus button at the bottom of the list, search for CryptoKit, and then add it. But as seen here, CryptoKit is not showing up in that list for some reason in Xcode 11.1. So we'll have to do it manually.

Go into the target build settings and search for "Other Linker Flags". You may need to switch the filter toggle in the top left corner from "Basic" to "All". We need to add -weak_framework CryptoKit to the field. (The "weak" part of that flag indicates "Use this framework if available, but do not require it.")

It should look like this:

32%20AM

I'm also going to file an issue with Apple regarding CryptoKit being missing from the list, because it's silly that we should have to do it this way. (FB7416313)

4 Likes