Inside Evernote Peek: How We Implemented Application Management with iPad 2 Cover
Habralud, using iPad 2, probably, already tried our Evernote Peek - the first-ever application which can be operated by means of a company cover of Smart Cover. Of course, shortly after the release we made it so that the application could be used on all iPads and without a cover, emulating actions with it using on-screen functions. However, it is more interesting, of course, to work in the Peek physical cover.
We have already written about the application itself, so we will not dwell on it in detail. For those who have not heard of the application, we will explain in a few words - Evernote Peek allows you to test yourself by answering a pre-prepared collection of questions. In practice, it is often used to prepare for a variety of exams, while learning a foreign language and for conducting various quizzes. Close the screen with the Smart Cover and then open the cover to see the question. To find out the answer - fold the cover completely. To make it clearer, here is a small introductory video:
')
How Peek Works with Smart Cover
One of the functions of Smart Cover is that the cover automatically sends the iPad 2 to sleep mode when you cover the screen and awakens the tablet from sleep when opened. This allows Peek to be managed using the cover. We used two methods of the UIApplicationDelegate protocol: applicationWillResignActive and applicationDidBecomeActive. As the English-speaking readers have already understood, applicationWillResignActive is called when the screen is closed by the cover, and applicationWillBecomeActive is called when the Smart Cover opens.
When you close the screen and the application prepares to exit the active state, the applicationWillResignActive sends a notification to our view controller to go to the next prompt. When you open the cover, the applicationWillBecomeActive sends a notification to play the sound of the page being turned over.
You have probably already noticed one peek of the Peek work: we do not explicitly define whether the Smart Cover is open or closed, since this cannot be done through the public API. Therefore, you can simulate the opening / closing action by simply exiting and re-entering the application. This feature actually came in handy during testing. However, this method of management also has weaknesses: it does not work if you have the cover / unlock screen disabled in your settings, or the iPad password is set. Finally, the partially closed Smart Cover confuses the iPad's ambient light sensor, so sometimes you have to adjust the brightness settings to make the Peek readable.
In general, the application of Smart Cover functionality in Peek was quite simple. Our lead iOS engineer, Steve, compiled a model of how an app works for an hour. It was more difficult to give the application the right look and display of interactions. Our lead designer, Gabe, Juan, and Carlos from MindsMomentum , as well as the development team for the Egretlist iOS application, worked together on this problem. Creating a Peek from start to finish, including all visual design and synchronization with Evernote, took them about four weeks.