{ ggrrrrrrrrhhhhh }

#define BUZZER_PIN 8

#define SILENCE  0
#define NOTE_B7  3951
#define NOTE_CS8 4435
#define NOTE_E8  5274

static const int notes[] = {

void playCommunicatorSound() {
  for (int i=0; i<12; i+=1) {
    if (notes[i] != SILENCE) {
      tone(BUZZER_PIN, notes[i], 102);


Ideally, games should not play their soundtrack when another app is playing music in the background.

To help us detect when another app is playing audio, Apple introduced the AVAudioSession.isOtherAudioPlaying property in iOS 6. This property will be set to YES while other apps play audio.

As of iOS 8, Apple recommends using a new property named secondaryAudioShouldBeSilencedHint.

AVAudioSession *audionSession = [AVAudioSession sharedInstance];
if (audionSession.secondaryAudioShouldBeSilencedHint) {
    // Silence...
} else {
    // Play soundtrack!

Detecting Changes

You might be asking yourself, “what if the music starts or stops while the user plays the game?” Enter AVAudioSessionSilenceSecondaryAudioHintNotification.

Your game can subscribe to AVAudioSessionSilenceSecondaryAudioHintNotification and be notified whenever other apps start or stop playing audio in the background.

[[NSNotificationCenter defaultCenter] addObserver:self

To glue everything together I recommend creating a “Soundtrack Manager” singleton class. The class should be responsible for playing the looping audio files that make the soundtrack, registering itself for secondary audio hint notification changes, and starting stopping the music accordingly.

Below are five tips for localizing iOS apps based on my own experience as a project lead and product designer:

1. Pick a Localization Management Platform

Long gone are the days of sending Excel sheets packed with localization strings back and forth via email. During the last few years, there has been a proliferation of web based tools for managing localization. These tools allow you to keep track of localization strings across multiple projects, collaborate with translators, even hire them right within the platform.

Some of the platforms that I have used or evaluated are:

Others that I haven't used yet, but I would love to try are Shuttle (Open source) and OneSky.

2. Automate

While localizing apps you will find yourself doing a lot of repetitive tasks such as exporting and importing strings, scanning your code for new strings, etc. The only way to keep this part of the process sane is by automating it as much as possible. Luckily, some of the platforms that I listed above already have APIs even command line clients to help you integrating them into your development pipeline.

3. Document

The translators are going to need as much information as you can give them. Start by writing down what your app does and what the use case is. This will give them the context they need to get started.

Take screenshots of every screen that needs to be localized. And if your app contains instructions such as “Go to Settings and enable Location Services” make sure you take screenshots of these steps in all your target languages. You want your translators to use the exact same text that Apple uses in their interface to avoid confusing the end user.

Settings app in Spanish

4. Dogfood

If you speak multiple languages try using your app in your other languages. Sometimes I change my iPhone language settings to Spanish, and use it like that for an entire day. I find this practice very helpful for refining localizations and spotting out possible layout issues.

5. Factor in Localization Time in Your Estimates

Localizing is a long term commitment. Once you localize, your users will expect your app to be always localized. If you add a new feature, that feature must be localized before you ship it. When estimating, always account for localization work and testing.

Ramon Torres - iOS developer/product designer

My name is Ramon Torres. I'm a software developer and product designer, currently working at Inkboard building cool stuff.