Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Prior to, and since posting this question almost 2 weeks ago I have searched high and low for a method to make the keyboard click sound work in my app. I have attempted to implement and understand <a href="http://developer.apple.com/library/IOs/#documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/InputViews/InputViews.html#//apple_ref/doc/uid/TP40009542-CH12-SW4">Apple's documentation on custom input views.</a> I butchered my app in many ways attempting to make it work and created several test projects. I tried to interpret how to do this from various other sources on the web. All to no avail. I have finished my app all but for this last function. </p> <p>I finally hit on a simple answer towards the end of <a href="http://www.iphonedevsdk.com/forum/iphone-sdk-development/103267-uiinputviewaudiofeedback-not-working.html">this IPhone Dev SDK form question/post</a>. The ultimate answer is easy and can be done in a few seconds with these easy steps. </p> <ol> <li><p><strong>Link the 'AudioToolbox.framework' to your project</strong> (Click on your project's Target, select 'Build Phases' and under the 'Link Binary with Libraries' item click the + button and add the framework.</p></li> <li><p>Add the following to the header file of the class where you want to implement the click:</p> <pre><code>#import &lt;AudioToolbox/AudioToolbox.h&gt; </code></pre></li> <li><p>Add the following line of code in the implementation file of your class wherever you want the keyboard click sound to appear:</p> <pre><code>AudioServicesPlaySystemSound(0x450); </code></pre></li> </ol> <p>THAT'S IT! AND IT WORKED!!! HALLELUJAH! </p> <p>According to Paul in the other forum this has the following downside:</p> <p>"keyboard keys won't be affected by the iOS user preference for keyboard sound on/off."</p> <p>But when I turn the volume up or down on my iPhone or if I mute the iPhone, the keyboard click sounds do go up and down or are muted as would be expected. Given that I found it impossible to implement keyboard clicks "UIInputViewAudioFeedback" as documented, I'm happy to have anything work.</p> <p>P.S. If anyone has a link to an actual project that I can download, build and run on my iPhone to see EXACTLY how to properly implement: "UIInputViewAudioFeedback" I'd be happy to give it a look. But so far I've found none, nor any step-by-step newbie style instructions on how to make it work.</p> <p><strong>[Sept 30, 2012 UPDATE:]</strong> I'm happy to say that my app was accepted into the app store using this method. Here it is: <a href="https://itunes.apple.com/app/fine-tip-tip-calculator/id563429225">https://itunes.apple.com/app/fine-tip-tip-calculator/id563429225</a></p> <p>...Dale</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload