One Touch Rotation Lock on the iPhone
One feature I get a lot of comments about in Read It Later Pro is the one touch rotation lock. When the user rotates their phone, it displays a lock icon for a brief second. If the user taps the lock, they can lock the rotation of the device so the view does not change. This is so much easier/faster than making a user go back out to the options screen and setting a toggle.
Since a lot of users have said they wished other applications had this feature I thought I’d release the source code so that other developers could easily add it if they wish.
How to Use
Every app is going to be unique, so depending on how your application and it’s views are designed, this may or not be a quick drop-in. I would start first by downloading and viewing the example project. There are two parts you would need to integrate into your application.1. Add the view controller additions to your UIViewController
Open OneTouchRotationViewController.h and OneTouchRotationViewController.m. You will see the additional properties and functions I’ve added to the UIViewController. In most cases, you can simply copy and paste them into your main view controller. The example project has no extraneous methods or code, so you should carry over almost all of the code from the two files into your own. Make sure you get:- The definitions in the header (.h) file.
- The #defined degreesToRadians function at the top of the .m file
- The OneTouchRotation enum
- The synthesized properties line
- The hideLockAfterNumberOfSeconds constant
- All of the source for the rotation functions listed in the .m file
2. Add the rotation notification
Where you put this may again depend on your application. If you open OneTouchRotationAppDelegate.m, you’ll see that I add it right when the application starts up. This event tells your view controller when the device has been rotated.3. Add the icon images
I provided the same icons I use in my own app. Feel free to modify them if you wish. You’ll want to add these to your own project by dragging both rotateUnlock.png and rotateLocked.png into your Resources folder in Xcode.Test it out
If you get stuck, start by taking a look at the example project included in the download.Download
One Touch Rotation Example Project and Source (1.0)iPhone Developers: Prepare Featured Artwork Ahead of Time
If you are an iPhone developer, I’d highly recommend preparing Featured Artwork files ahead of time. If Apple contacted you and wanted to feature your app, would you want anything to stand in the way of that happening? I received a brief email from Apple in early in August requesting artwork for a ‘potential marketing opportunity’. The opportunity turned out to be Read It Later being featured in the Apple App Store. The email came in late on a Tuesday and had requested artwork files for first thing Thursday morning. In reality, this gave me about a day to put everything together and send it. However, during that time I was scrambling to get some other work finished before I left for a trip at the end of the week. There was no way I was going to miss the chance for whatever this opportunity was so I ended up having to forfeit some other important tasks in order to make room for this. It would have been much better if I had this work ready to go ahead of time. In fact, details about having these files are in the ‘developer guide’. The guide is linked to from the bottom of the iTunesConnect window and the details of the featured artwork are buried near the end of the PDF. Admittedly, I had never seen it, and from the developers I spoke with, a lot of others haven’t either. I wanted to share my experience so in case other developers were not aware of this they could be better prepared than I was. Though it meant I had to put off some other work that week to put the files together, the result of being featured was definitely worth it.
The Requested Artwork
They request two artwork files. The Apple designers will actually take bits/pieces from these and rearrange them as they see fit based on the image they are trying to create. (More on that below)
Title Treatment - This is a 600 x 600 image of your logo/title. The background should be transparent and it should exclude tag-lines if the text will not be legible at a small scale.
An example of the Title graphic for Read It Later is shown to the side.
Background Treatment - This is a 900 x 530 layered PSD. What you put in this file is fairly open. Apple states: “The background image, texture, color or gradient should correspond to the application or compliment the title treatment. It may include elements of the application itself, but should not be or include screenshots.”
The approach I took was to provide them with a gradient background in one layer and then a main graphic that could accompany the logo.
My Submitted Artwork
Just as an example (you wouldn’t send this together), here is a close up of the combined artwork:
Apple’s Design
As I mentioned, Apple will take the artwork you send them and put it together in a way they see fit. You should try to keep all the graphical elements in separate layers in Photoshop to make this easier for them. If you have some graphic elements that must be laid out in a specific way, I’d suggest merging the layers so the designers do not break them apart as they will not consult you prior to the graphics being made. Here are the three images that I saw during the time it was featured. As you can see, they significantly rearranged the graphics I sent them. (I think they turned out nice, just making the point that this may happen).On the featured tab of the App Store App:

Big promo on the main App Store page in iTunes:

Mini promo on the main App Store page in iTunes: