UbiquityIdentityToken in Swift 3

Anyone else know why this always returns false in the new Swift 3? It used to actually indicate whether iCloud was enabled on the device or not in previous versions of Swift.


if FileManager.default.ubiquityIdentityToken != nil {

return true

}

else {

return false

}

Replies

I don’t think this has anything to do with Swift 3. I ran your code in a newly-created app here in my office and it worked just fine.

If you’re getting back nil for

ubiquityIdentityToken
it’s likely that either:
  • Your app is not set up for iCloud, or

  • iCloud is not set up on your device properly

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"