Inside Evernote Peek: How We Implemented App Cover Management for iPad 2

    image
    Habralyudy, using the iPad 2, may have already tested our Evernote Peek - the first application in the world that can be controlled using the proprietary cover Smart Cover. Of course, soon after the release, we made it so that the application could be used on all iPad without a cover at all, emulating actions with it using on-screen functions. However, it is more interesting, of course, to work in Peek with a physical cover.

    We already wrote about the application itself, so we will not dwell on it in detail. For those who have not heard about the application, let’s explain in a few words - Evernote Peek allows you to test yourself by answering a pre-prepared selection 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 Smart Cover and then open the cover to see the question. To find out the answer, minimize the cover completely. To make it clearer, here is a short introductory video:



    How Peek works with Smart Cover



    One of the features of Smart Cover is that the cover automatically puts the iPad 2 to sleep when you cover the screen and wake the tablet from sleep when you open it. This allows you to implement Peek control using the cover. We used two methods of the UIApplicationDelegate protocol : applicationWillResignActive and applicationDidBecomeActive. As English-speaking readers already understood, applicationWillResignActive is called when the cover is closed, and applicationWillBecomeActive is called when the Smart Cover opens.

    When you close the screen and the application prepares to exit the active state, applicationWillResignActive sends a notification to our view controller to go to the next prompt. When you open the cover, applicationWillBecomeActive sends a notification to play the sound of the page being flipped.

    You probably already noticed one feature of Peek: we do not explicitly determine whether Smart Cover is open or closed, since this cannot be done through the public API. Therefore, you can simulate the action of opening / closing by simply exiting and re-entering the application. This feature actually came in handy during testing. However, this control method has its weaknesses: it does not work if you have disabled cover lock / unlock in the settings or set a password for access to the iPad. Finally, the partially closed Smart Cover confuses the iPad's ambient light sensor, so sometimes you have to adjust the brightness settings to make Peek easy to read.

    In general, applying the Smart Cover functionality in Peek was quite simple. Our lead iOS engineer, Steve, drafted an application model for an hour. It was more difficult to give the application the correct appearance and display of interactions. Our lead designer Gabe, Juan and Carlos from MindsMomentum , and the team of developers and designers of the Egretlist iOS application worked together on this problem . Creating Peek from start to finish, including all the visual design and synchronization with Evernote, took them about four weeks.

    Also popular now: