Database Reference
In-Depth Information
Controlling iCloud with Settings
We need to give the user the ability to turn iCloud on or off. This is best handled in Settings for
the app because it will remain out of the way of our content, but will give the user a place to go if
they want to turn it on or off. Adding this is an easy process. We start by adding a new file that is a
Settings Bundle. This can be found under the iOS ➤ Resource category when adding a new file as
shown in Figure 5-1 . The name by default is Settings, which is fine for what we need.
Figure 5-1. Creating a Settings Bundle
If you expand the Settings.bundle in your Project Navigator you should see a file named
Root.plist . Select that file so we can look at it.
This plist has a root node that is a dictionary. It is called “iPhone Settings Schema.” Inside there is an
array named “Preference Items.” And inside that you should have four Dictionaries. To keep things
simple we want to delete all of them except the item that has a toggle switch.
Now expand the item that is the toggle switch and let's change a few things. We want our default
value to be set to “NO.” The reason behind this is that you don't want to force anyone to use iCloud.
Think of this as an added feature for your user. Next we want to change the Identifier to
“ICLOUD_ON.” Now change the title to “Use iCloud.”
 
Search WWH ::




Custom Search