Fair distinction — you're right that print(…) and _ = aren't equivalent, and I conflated them. Our code had the _ = variant, which is why it failed silently.
That said, our recommendation remains: explicit framework linking under Build Phases → Link Binary With Libraries is more reliable than either source-level approach, because it can't be affected by optimizer decisions at all — it's a linker directive, not a Swift expression. Whether print(CKRecord.self) survives in all build configurations may depend on inlining, LTO settings, or where in the call graph it appears. Explicit linking has no such dependencies.
For anyone reading this thread: verify with otool -L on your actual built binary before assuming any source-level workaround has taken effect.
Topic:
App & System Services
SubTopic:
iCloud
Tags: