How can CloudKit environment be determined at runtime?
问题 Is there a programmatic way to discover whether my app is talking to the CloudKit Development or Production environment? (I know I can look at the com.apple.developer.icloud-container-environment key in Entitlements.plist to make an intelligent guess, but that doesn't really -prove- which environment I'm using.) 回答1: As of now you can use an extension on CKContainer . This can be very helpful for debugging and development purposes. extension CKContainer { public var isProductionEnvironment