Aleksandar • Vacić

iOS bits and pieces

Putting Sensor Tower to work

I have spent a lot of time in the last month or so working on Banca, updating it for iOS 8 and new iPhones. Thus I wanted to make sure I did anything I could to get people to at least check it out. One aspect of that is better placement of the app in the most important searches. Banca is currency converter app, a field that’s very crowded with many free apps. Thus competing as paid app in there (IAP really makes no sense for an app like this) is challenging, to put it mildly.

Thing is, how exactly to do this? It’s not like every app developer goes and post his keywords, so you can see what the best ranked ones are using. After quite a lot recommendations from friends, online and offline, I went to check Sensor Tower. Among many other services, they prominently feature keyword research, suggestions, tracking, even translations.

Right on their homepage you have an option to guess the keywords of any app. I picked Banca and was floored with the result.
They returned almost every good keyword, even the more obscure terms I used. Wow; talk about a good start.

Allow landscape, only on iPhone 6 or 6 Plus

I sort of already solved this - how to allow certain orientation per view controller, late last year while (surprise!) working on the very same app I’m updating now: Banca currency converter.

However, this is a bit different. iOS 8 brings size classes, deprecates old orientation callbacks and in general tries to move away from dealing with fixed numbers.

Oki, what’s the deal here; iPhone 6 Plus has a system-wide support for operating in landscape mode, including home screen arrangement with the dock on the side. Thus it’s more than expected that our apps should work in landscape on iPhone 6 Plus. Gone are the days when you could get away with just Portrait, since that is the natural way to hold the iPhone (for all but video and games).

Phantom spaces in UILabel's text

Yesterday, I posted an article about how I apparently found a bug in NSAttributedString, happening only on device. I was wrong. There’s no bug, only me being tired (I posted that article at 4am) and not looking for source of the issue hard enough. Here’s what really happened.

While working on Today extension for Banca, I encountered an issue that killed me at least a day or so of productivity. I have a table cell that looks like this:

Right-hand labels have NSTextAlignmentRight set on them and it worked fairly well during inital spec-ing of the cell and even during entire development in the Simulator. It went downhill as I moved to my iPhone.

How to remove UINavigationBar's bottom border / shadow in iOS 7

One of the most annoying visual things Apple introduced in iOS 7 is inability to remove the navigation bar shadow image. iOS 7 UI is perfect to create seamless transition between the content and the top of the screen.

The only issue is that darn line at the bottom. There is no property on UINavigationBar to hide it. There is shadowImage which allows you to change it, but can’t remove it – shadowImage = nil is the default which shows their default image. Even changing the shadowImage to 100% transparent image is not enough:

For a custom shadow image to be shown, a custom background image must also be set with the setBackgroundImage:forBarMetrics: method. If the default background image is used, then the default shadow image will be used regardless of the value of this property.

Brilliant. 😕 You can remove the shadow only if you also kill the blur, like this:

[self.navigationController.navigationBar setBackgroundImage:[[UIImage alloc] init]
self.navigationController.navigationBar.shadowImage = [[UIImage alloc] init];

Can’t help to think this was not properly thought through, but given the hectic schedule Apple engineers had for iOS 7, something had to give. Anw, with no other avenue left, it’s subview walkthrough time.