RMShapedImageView: A UIImageView subclass that ignores touches on transparent pixels

When using transparent PNG images in iOS development sometimes it’s useful to limit touches to where the image is not transparent.

Artwork from

You don’t want to interact with the bird if you touch the top left or bottom right corners.

For UIButton, there’s the most excellent OBShapedButton by Ole Begemann. At Robot Media we also needed this for UIImageView. After asking about this problem on StackOverflow and studying OBShapedButton, I decided to create RMShapedImageView and open-source it on GitHub.

RMShapedImageView is a UIImage subclass that overrides pointInside:withEvent:. This method is called to determine if a touch is inside the view. In our case, we only want to return YES if the corresponding pixels are not transparent (alpha > 0).

Usage

  1. Add RMShapedImageView.h and RMShapedImageView.m to your project.
  2. Replace your UIImageView with RMShapedImageView either in code or Interface Builder (by setting the Class of your UIImageView to RMShapedImageView).
  3. Profit! 

RMShapedImageView works with retina and non-retina images, as well as transformed views. It’s particularly useful is you’re using gesture recognisers. Currently supports only two content modes: UIViewContentModeScaleToFill and UIViewContentModeTopLeft. More will be added in time.

Configuration

Touches are inexact things and querying the alpha value of a single pixel might be too strict, even more so if the image is scaled down. Furthermore, if the image has shadows you might also want to ignore touches on them. RMShapedImageView has two configuration options to work around these problems:

  • shapedTransparentMaxAlpha: maximum alpha value that will be considered transparent. 0 by default.
  • shapedPixelTolerance: number of pixels around the point that will be examined. If at least one of them has alpha bigger than shapedTransparentMaxAlpha pointInside:withEvent: will return YES. 0 by default.

The project also includes a demo and bare-bones unit tests and is distributed under the Apache License 2.0. You’re more than welcome to fork it and improve.

App Store keywords checklist: 21 tips to work around Apple’s horrible search

App Store icon

Don’t you hate those articles about App Store marketing who basically tell you you need to build a great app*? Me too.

Here are 21 practical and actionable tips to get the most from your App Store keywords, with real examples from my Mac app Email Contacts Extractor, references and further resources.

Let’s see how many of these you know already.

Basic tips

All of these tips can be found in the documentation provided by Apple.

  1. You can only use up to 100 characters for keywords.[1]
  2. Each word in your app title and company name counts as a separate keyword.[2]
  3. The description does not count as keywords.[3]
  4. Separate keywords with commas.[1]
  5. Keyword changes require an update of the app binary.[1]
  6. Prefer specific keywords.[4] E.g., extractor is better than tool.
  7. Each keyword must be more than 2 characters.[1]
  8. Keywords that use offensive language or are trademarked or that reference another app’s name or company name, might cause your app to be rejected.[1] However, many product or brand names are accepted based on the context of the app, so try them if appropriate. E.g., gmail.

Intermediate tips

Improve your chances with these tips learned by trial and error.

  1. Separate keywords with “,” but not “, ” (no extra space) to save characters.
  2. Use single words keywords but not phrases (even if the iTunes Connect Guide says otherwise). Searches that are a combination of your keywords will display your app too. E.g., “extract,contacts” instead of “extract contacts“.
  3. Consider including plurals if the App Store does not recognise them. To test this, first submit your app without plurals and search your desired plurals. Then upload a new version with the plurals that are not recognised by the App Store.[5] E.g., addresses.
  4. Category names no longer count as keywords. In any case, only use a category name as keyword if your app is very popular within that category or if the category is not too crowded.[6]
  5. While it’s not possible to know which keywords are more frequent, it is possible to scrap the App Store for common words in app titles. The last list I found was compiled by AppsFire. You might want to avoid adding any of these as additional keywords.
  6. If your app is free, you don’t need to include free as a keyword, although you might still want to include it in the app title for marketing purposes.[7]

Advanced tips

You should follow these tips if you plan to make a living from your app.

  1. Different countries produce different search results. You can localize both your app title and keywords. You can also change the App Store country to test the results. On iPhone: open the App Store, select the Featured tab, scroll down to your account and tap, change country region. On Mac: open the App Store, selected the Featured tab, scroll down, tap on the country flag.
  2. While it’s not possible to know which search terms are related in the App Store, we can consider Google searches as an approximation. Use Google Keywords Tool (limited to mobile traffic and each desired country) and Google Trends (limited by country) for ideas. E.g., using this I found that “export“, “backup” and more frequently used than extract in the context of email contacts export.
  3. iTunes and the iOS App Store sometimes produce different results. Try both.
  4. Consider including common misspellings as keywords. E.g., adress.
  5. Consider using services that track your keywords ranking, such as AppCod.esMobileDevHQ and AppStoreRankings. Unfortunately I can’t endorse any as I haven’t used them yet.
  6. In-app purchase titles do not count as keywords anymore.[7]
  7. Keywords might be deactivated by the App Review team without letting you know (unverified).[8] Make sure you test them all after releasing the app.

Bear in mind that the above change every so often. If you found that any of the tips doesn’t work anymore, please leave a comment below.

This post was all about keywords. For a more generic introduction to App Store Optimisation (ASO), you might want to read apptamin’s checklist.

* (BTW, they’re right)


1. ^ a b c d e App Store Resource Center – Marketing Resources.
2. ^ iTunes Connect – Frequently Asked Questions > App Store.
3. ^ iTunes Connect – Frequently Asked Questions > Manage Your Applications.
4. ^ iTunes Connect Developer Guide – Best Practices.
5. ^ App Store Optimization (ASO): App Name And Keywords.
6. ^ Category names no longer work in App Store search on the device.
7. ^ a b New rules in App Store Search.
8. ^ “SEO Optimizing” Your App for iTunes – Part 4 (Additional Findings).

How to export your contacts from Gmail

I maintain a personal mailing list of my most frequent contacts, which is basically used to send holiday greetings. Through the years I laboriously added new contacts, and removed the ones I hadn’t messaged in a while. This year I decided to create an app to do this automagically: Email Contacts Extractor.

I decided so after exploring various options to export my contacts from Gmail. Below are the top ones, and why I think my app was necessary. Either if you want to create a personal mailing list or backup your email contacts, these are the top options you should consider.

Export from Gmail (free)

Gmail screenshot

Google makes a serious effort to allow users to export their personal data, and Gmail is no exception. Gmail provides free built-in support to export all your email contacts as a CSV with just a few clicks.

When you select All contacts, Gmail differentiates between a contact and an email address. This is particularly useful if you’re planning to build a personal mailing list. Robot accounts (no-reply@) and spammers should be ignored, resulting in a list of mostly humans who interacted with you at some point in time.

Unfortunately, the exported file tells you very little about how you interacted with these contacts. When was the last time you contacted them? How many times? I find this information is essential to minimize the risk of spamming people who barely know you.

Gmail does provide a Most Contacted list limited to the top 20 contacts, which I found too restrictive.

PRO: free and does a good job at filtering your contacts.
CON: does not provide information about how you interacted with them.

WriteThat.name ($59)

WriteThat.name screenshot

There are various paid online services that automatically update your address book as your receive email. WriteThat.name, a fellow Seedcamp company, is the best-looking one and can also scan past email for an extra fee.

I say “best-looking” because I haven’t tested it, for a very simple reason: I’m not comfortable giving access to my email to third-parties. Security leaks happen, companies disappear, or need to make cash quickly, and I don’t like my email to be involved in any of that.

If you don’t have my privacy concerns, WriteThat.name looks like a great solution. At the date of writing this article, extracting all your contacts would cost you $59 the first year.

I might give it a try when they are acquired by Google.

PRO: looks good.
CON: privacy concerns and costs a bit of money.

Email Contacts Extractor ($19.99)

Email Contacts Extractor screenshot

Wouldn’t it be nice to have an app that:

  • can export your email contacts
  • without giving access to your email to anyone
  • and by providing context about how you interacted with them?

Email Contacts Extractor is Mac app that does exactly that, and I built it myself for myself. It extracts all your email contacts from Mac OS X Mail or Outlook in just a few minutes, and saves them as a CSV file. You can then sort your contacts by name, last message date, rating or contact frequency. Works with Gmail and any other service that can be added to Mail via IMAP or POP. And has many more features.

I figured $19.99 was a fair price for such a utility and put it on sale on the Mac App Store. It sells a couple of units per day, which pays for the coffee I don’t drink.

PRO: does not have the CONs of the previous options.
CON: only for Mac.

Don’t give out your iTunes Connect password so easily!

We iOS and Mac developers love our sales and download numbers.

We love them so much that we will gladly give our iTunes Connect password to any company that provides shinny graphs of them.

You know you love them.

You know you love them.

There’s absolutely no need to give out your main password to services like AppFigures, App Annie or Mopapp. I’m sure these companies mean well and invest heavily in protecting your information. Unfortunately, in order to extract the data from iTunes Connect they’re forced to store a (hopefully encrypted) copy of your password. And we already know how that might end, don’t we?

It’s simple and you probably know how to do it already. iTunes Connect supports having multiple users for the same account, with different roles. Within iTunes Connect, go to Manage Users and select iTunes Connect User.

iTunes Connect screenshot

Then provide a descriptive name and an email address which needs to be different from yours. Fortunately, you don’t event need to have a different email account. If you’re using Gmail, just add a + suffix to the local part of your email address. Like this:

johndoe+appfigures@gmail.com

iTunes Connect will accept this as a different email address and all emails will go your inbox.

Finally, select the Finance or Sales role (as needed) and skip all notifications. Apple will send an activation email to your email account (if you used the + suffix).

Before clicking on the activation link you need to logoff from iTunes Connect (or open it in a new browser). Provide a password (a new one, of course) and presto, now you have a shinny new iTunes Connect user with limited access to your account.

Give this user to the App Annies of the world. If anything goes south, you can simply remove it form iTunes Connect.

Rejected from the Mac App Store for checking for updates

The first personal app that I submitted to the Mac App Store was recently rejected. Was it the subject matter? A bug? Too ugly? Not at all: the app displays an alert when an update is available, and according to an Apple employee “update checks” are forbidden.

WTF

This post is sponsored by WTF, the World Taekwondo Federation.

Notifying the user that a new version is available is a very common feature in apps: you want your users to be using the latest version. It’s so common that there are many open-source libraries that do this automatically, such as iVersion, the one I used. Unfortunately, It appears that the Apple employee who reviewed my app has a misconception about iVersion. Quoting the rejection message:

The app updates itself outside of the Mac App Store, the app uses iVersion to update the app,

The Mac App Store provides customers with notifications of updates pending for all apps delivered through the App Store, and allows the user to update applications through the Mac App Store app. You should not provide additional update checks or updates through your app.

The Mac App Store Review Guidelines (developer account needed) do, in fact, forbid apps that “use update mechanisms outside of the App Store” (rule 2.21). This is not the case with iVersion, as I explained to the Apple review team:

The app does not update itself outside of the Mac App Store.

When opened, the app consults the App Store API (provided by Apple) and checks if a new version is available. If it is, it shows an alert to the user, offering the choice of opening the App Store.

No update is provided within the app, and the update check is done via the App Store API.

Unsurprisingly, I received no reply. Given that I didn’t consider this issue important enough to delay the release any further, I removed iVersion from the app and resubmitted.

How did Apple find out that I was using iVersion? Quite simply, I told them. Unlike iOS apps, Mac apps require entitlements to use key OS features, such as network access. iVersion uses network access to check for the latest version in the App Store, and Apple requests you to explain how each entitlement is used when submitting the app.

You could argue that iVersion is not necessary. After all, the Mac App Store provides notifications for updates. As an user -and as the number of apps that I install from the Mac App Store grow-, I tend to postpone dealing with these notifications as many are from apps that I’m not currently using. Thus, I believe there is value in opening an app and being told that an update for that app is available.

What’s worse is that there’s plenty of apps in the Mac App Store that use iVersion, or have a similar feature. Lesson learned: the more you tell Apple about your app the most likely it will get rejected.

Update: iVersion’s author agrees with the conclusion.

3 tips to save you clicks this 2013

Hand with red pill

Warning: these tips are akin to choosing the red pill on the Matrix.

Below are 3 pro-tips that I learned in late 2012 and I plan to extensively use for the rest of my life. If you’re like me they will blow your mind. And we shouldn’t rest until the whole world knows about them (up to you; I’ll stop after I publish this article).

Keyboard Shortcut to Copy and Paste Without Formatting

tl;dr: Option+Command+Shift+V (Mac OS X) and Ctrl+Shift+V (Firefox/Chrome).

You copy a piece of seemingly harmless text. You paste it somewhere else. Damn, it’s infected with format!

This happened to me so frequently that I eventually started keeping a copy of Notepad (Windows) or plain text TextEdit (Mac OS X) always open, as an format-stripping tool: copy, paste into the text editor, copy again, then paste into the real destination.

Turns. Out. There’s. A. Keyboard. Shortcut. For. This.

On OS X you can paste without formatting1 with the “shortcut” Option+Command+Shift+V. That’s it. Neat, uh?

Also, both Chrome2 and Firefox3 support the shorter shortcut Ctrl+Shift+V. This works both on Windows and OS X.

Unfortunately there’s no general shortcut for Windows. You can either stick with Notepad-hopping, or use an app like PureText.

(credit to @stefanklumpp for enlightening me)

Multiple Users in Google Chrome

tl;dr: Google Chrome supports multiple users with separate history and cookies.

You have a personal Gmail account. And one or more Google Apps accounts. And maybe a separate email for YouTube or AdMob (or any other silly Google service that doesn’t support permissions).

You have a problem.

You tried Google multiple account sign-in and it failed you. Maybe you use one browser for one account, and another browser for the other, consuming half your RAM in the process.

Enter Google Chrome multiple user management. Turns out Chrome simply allows you to have multiple instances of Chrome with separate history and cookies. They call it “users”.

They say it is designed for people who share their computer. Pff. This is exactly what us Google account polygamists always wanted!

Here’s how I use it:

My Google Chrome multi-user setup

I actually have many more now. I’m addicted.

(credit to the GDG Barcelona organisers for showing me the path)

Auto-fill a Formula Downward in Spreadsheets

tl;dr: select the cell and double-click on the fill handle.

There’s this spreadsheet with thousands of rows. And there’s this cell in the first row whose formula you have to expand to all the other rows.

You select the cell, press the fill handle and begin scrolling, on and on and on. After passing the first thousand rows your mouse acts against you and you loose all your progress. Then you start again.

You were so close. Did you know that if you had double-clicked the fill handle it would have filled all those cells for you?

This simple gesture will automatically fill a formula downward, for all adjacent cells that it applies to. It also works for repeating values and is supported in Excel, OpenOffice and Google Docs. Wowza!


Hopefully at least one of the above tips was new to you and I just saved you a few minutes per year. Use this year’s to go outside and buy yourself an ice cream in my honor, please.

Wouldn’t it have been nicer if this article were “13 tips to save you clicks this 2013″ instead of 3? Yeah, it would. Maybe next year.


1. The OS X shortcut actually does something slightly different. Quoting the documentation: “Apply the style of the surrounding text to the inserted object (Paste and Match Style).” In other words, if you paste into something that doesn’t have formatting, the formatting of the inserted object will be stripped. If you paste into something with formatting, the inserted object will match the existing formatting.
2. Documented for Windows but not for Mac. On Mac, the behaviour of Ctrl+Shift+V on Chrome is the same than Option+Command+Shift+V (Paste and Match Style).
3. Not that the Firefox documentation would tell you, but it works.

Sententia

I strongly believe in adding value. Online, I mostly do it via twitter, github and stackoverflow.

Sometimes I want to share more than code, or use more than 140 characters to express myself.

On the other hand, I have a mild dislike for social networks, their devaluation of privacy and ownership.

Hence this blog. Welcome!