Dealing with MKMapView’s Google logo with translucent toolbars
One of the iPhone applications I’ve written, Parking Mobility, is primarily a map-based application. Since the iPhone’s screen is so small, we want to maximize the screen real-estate while still providing navigation bars for users to interact with. To that end, the app uses a black-translucent navbar and toolbar at the top and bottom of the screen. In the past this has never been a problem, and most mapping applications do the same thing. I recently submitted a huge update to the app which is a complete re-write as a 100% native Objective-C based application (all vestiges of PhoneGap having been removed). With this latest submission though, we’ve run into problems.
Read on for more, and what I’ve done to (hopefully) get around this.
Why the update got rejected
I’ve always known that Google’s licensing terms for using their maps has stipulated that you have to show Google’s branding unaltered. This wasn’t a problem because the map tiles themselves have the logos emblazoned on them, plus you can still see the logo through the semi-transparent view of the toolbar.
This time though, the app got rejected. Here’s the screenshot they sent me, showing where the violation is taking place. The “Go” of “Google” is under the Add button. Previous submissions to the App Store didn’t have problems with this.
Oh well, live and learn. My only problem is that I don’t want to change the application to using opaque toolbars, since the extra screen real-estate is handy.
After digging through the documentation a bit, I wasn’t able to see any direct way of moving the “Google” logo. So I began treading into the uncertain waters of directly manipulating the subviews of the MKMapView object.
MKMapView Additions
Due to the wonders of Objective-C’s Category features, I’ve added an additional property to the MKMapView object that exposes the Google Logo UIImageView. Using my powers for good, and not evil, I’m hoping that by moving the logo into view my app will be approved, and business can carry on as usual.
The real meat lives here, which exposes the logo view, if it can be found:
After that, it’s trivial to hook it into your map’s view controller to relocate the logo’s view, relative to your toolbar:
The result looks really good, if I do say so myself. When the app first starts, or as the phone is rotated, the Google logo safely moves itself aside so it’s in the location it was intended to be.
Crossing my fingers
I’m hoping this update to the app will be approved by Apple, since I’m adhering to the intent of the logo visibility requirement. I’ll update this post in the future to let you know whether or not Apple likes my solution.
Either way, this was a fun little 20-minute tweak.
Update: The app got accepted with this update to the map. So it would seem Apple doesn’t disapprove of this technique. Yay for digging through the UIView hierarchy and JFDI!