Database Reference
In-Depth Information
Once your app gets out into the hands of the public, you'll find that actual continuous use of your
iCloud-enabled app can result in many different issues of conflict. While this is inescapable, you
could be including unnecessary conflicts in your app that are easily avoidable. For example, in an
app that saves edits and updates to a document, the document should not be saved unless an edit
was actually made.
Let's say you create a photo-editing app that lets you edit several photos at a time. If someone
makes several edits to their photos while on their iPhone, those edits should appear on their other
devices. However, if that person decides to later scroll through to the end of those photos on their
iPad, but never actually makes any changes to the photos, should the simple fact that the user
scrolled be saved and pushed to other devices? When the user opens the photos on the MacBook
Pro, should they be scrolled to the end as they were on their iPad? Most likely the answer is no.
This is an unhelpful and trivial save that will consume the user's network bandwidth and their
device's battery.
Editing a Document on Multiple Devices
Earlier I talked about testing different devices and editing documents at the same time. Here is a
walkthrough of how to do that, only we'll take it a step further and test while one of the devices is offline.
1.
Connect two devices that can run your app to a single iCloud account.
2.
Open a document in your app on both devices so that they are running at the
same time.
3.
On one of the devices, turn on Airplane mode, and then edit the document.
4.
Now, edit the document on the other device, which is left online.
5.
Finally, turn off Airplane mode on the first device, so that both devices are
online. On each device you can now check whether the conflict resolution
behavior acted as you intended.
You can then run the same test, only before editing the documents, put both devices in Airplane
mode. You can play with this by turning off Airplane mode on one first, and then the other, or
attempting it at the same time. Again, check whether the conflict resolution that took place is what
you intended.
Testing Forward and Backward Compatibility
Once you have multiple versions of your app, you can test the forward and backward compatibility
of your document format.
1.
Install the oldest supported version of your app on one device, and then
install the newest version on the second device.
2.
On each device you will need to create a document, before allowing enough time
to elapse so that the document from each device appears on the other one.
 
Search WWH ::




Custom Search