O'Reilly logo

iOS 7 Programming Cookbook by Vandad Nahavandipoor

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 22. iCloud

22.0. Introduction

iCloud is Apple’s cloud infrastructure. A cloud is a name given to a service that stores information on a centralized location, where the user cannot physically access the disk/memory that stores the information. For instance, an iCloud storage space could be allocated by Apple in California, and all iPhone devices in New York could have all their iCloud traffic go to the California iCloud data center.

The purpose of using iCloud, from a programmer’s perspective, is to give their users the ability to seamlessly have their apps’ data transferred from one machine to the other. Let’s have a look at a real life example of when iCloud would come in very handy: imagine that you have developed an app called Game XYZ. Sarah is a hypothetical user of your game and she has purchased it through the App Store. Your game is a universal app, and hence can be run on both the iPhone and the iPad. It just so happens that Sarah has an iPad and an iPhone, and has installed your game on both her devices. She is playing your game at the office, and is at level 12. She goes back home and picks up her iPad to play some more, only to discover that the game starts from level 1 on her iPad because she was playing on her iPhone all along. This is definitely not a pretty situation. What is better is for your game to be intelligent enough to save its state and resume that state when your users start the game, regardless of which device they have been running the game. To ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required