Plays Sound Property of UIButton in Interface Builder
You can use [[UIDevice currentDevice] playInputClick];
to play the keyboard input click sound which is available in UIDevice
. Check this apple documentation for more details.
You need to do the following for this,
- Adopt the
UIInputViewAudioFeedback
protocol in your input view class. - Implement the
enableInputClicksWhenVisible
delegate method to return YES.
Do this in UIView
class,
@interface MyView : UIView <UIInputViewAudioFeedback>
Then implement enableInputClicksWhenVisible
method
- (BOOL)enableInputClicksWhenVisible
{
return YES;
}
If you are facing issues with this, you can check this.
iPhone: how to make key click sound for custom keypad?
The simplest way I've found is to extract Tock.aiff (the keyboard sound) from the iPhone Simulator and package it with your app, then play it using AudioServicesPlaySystemSound()
at the appropriate time. On my machine, simply typing Tock.aiff into Spotlight turns up the file, but if you have to go looking for it, it's in the simulator version of UIKit.framework.
Playing audio from a selected table cell stored in an array created from a Struct
Try deleting .mp3
from the URLs in audios
. URLForResource:withExtension:
takes the extension separately.
Related Topics
iOS 11 CPU Throttling and Idle Timer
Receipt Validation in iOS Returns Incorrect Info During Sandbox Testing
How to Change Tabbar Icon Color in iOS
How to Set The Date and Time Programmatically in iOS
iOS - Running Background Task for Update User Location Using Swift
What Is The Purpose of Launch Images in an iOS Application
Left-To-Right Mark Not Working in Swift
Responseserializer 'Cannot Call Value of Non-Function Type 'Nshttpurlresponse'' with Swift 3
Uibutton Target Action Inside Uiview
Programmatically Change Splash Screen in iOS
Get Path to Subdirectory in Resources Folder
App Crashes After Updating Coredata Model That Is Being Displayed in a UItableview
Bug When Trying to Parse Date in Objective-C
Uicollectionview Inside Tableviewcell Not Called
Swift Unrecognized Selector Sent to Instance - What Am I Missing
How to Get Nsnumberformatter Currency Style from Isocurrencycodes