To run your app in iOS Simulator, enter the iCloud credentials in iOS Simulator
before you select the simulator and click the Run button in Xcode. You need to
perform these steps for each iOS Simulator you select in the Scheme pop-up menu in Xcode.
To enter iCloud credentials in iOS Simulator
Choose Xcode > Open Developer Tool > iOS Simulator.
In iOS Simulator, choose Hardware > Home.
Launch the Settings app and click iCloud.
../Art/3_icloud_settings_2x.png
Enter an Apple ID and password.
Click Sign In.
Wait while iOS verifies the iCloud account.
To enable iCloud Drive, click the iCloud Drive switch.
If the switch doesn’t appear, iCloud Drive is already enabled.
For how to create an iCloud account, read Create an iCloud Account for Development.