UITextView doesn't play click sound - ios

In my app, I have created a UITextView and add to main view, but when it becomes first responder and start input, I can't hear keyboard click sound. Even I have enabled it in setting->sound, but still not work. Does anyone have idea on this? Thanks

Maybe you not enough pushing on keyboard? :)
SRSLY: sound not depends on UITextView, it depends on whether or not sound enabled and sound volume. AFAIK you can't control keyboard's click sound programmatically.
So you need to check your device sound settings.

Related

Register multi-touch as a single touch?

Is there a way to register multi-touch as a single touch? Say if I use three fingers to tap a large button, can it be registered as simply one tap of the button? -- the current default appears to treat it as a multi-touch, and as a result ignores the button-pressing altogether. Similarly, if I use my palm to tap a large button, the button isn't pressed either.
I noticed in iphone Accessibility Settings -> Touch Accommodations, one could set "Ignore Repeat" and "Use Initial Touch Location" for tap assistance. Of course, if those are turned on, it affects the entire phone instead of just one app. But would that be the direction to approach this problem?
BTW I don't actually need multi-touch in my app. So if turning off multi-touch can be more simply done on the whole-app level instead of button-by-button, it would suit this case very well.
Thank you #DonMag for providing a hint.
So, if yours is an ios app from Capacitor, here is how to change your javascript code:
Change your button onClick events into "onTouchStart"
Use a state variable to keep track of whether "onTouchStart" is triggered and the resulting logic is executing. During that execution, prevent more touch events to have further effect on the button. This is to prevent the button from being pressed in quick succession by multiple touches that come from, say, your three-finger tap or palm tap. Only after the execution is finished do you revert the state variable back to the original value, so that the button is ready to be pressed again.
If there is an answer that's more suitable for the native Swift bundle I'll accept that as the answer. The above is just to help anyone who may encounter the same problem as mine.

How can I detect from iOS Keyboard extension if user scrolled up the Control Center?

I develop an iOS Keyboard extension, and I'm using scroll gestures on keyboard. Sometimes when using the keyboard I scroll up the control center and my keyboard stops working fine. Is there any way to detect if control center become visible, or invisible?
You can't do it directly. The most you can know is that your app was deactivated and then activated again. It could be because of the control center, it could be because of the notification center, it could be because a phone call came in, it could be because the user went into the app switcher and came back again...
Here is the possible work around you can try:
It is the UIWindow subclass to enable behavior like adaptive round-corners & detecting when Control Center is opened. This UIWindow subclass does probably the thing you want. You simply subscribe to an NSNotification and can react to the user opening Control Center. Detailed instructions and setup on Github
https://github.com/aaronabentheuer/AAWindow
[AAWindow: The way this is accomplished is by using a combination of NSTimer and overwriting sendEvent in UIWindow to receive all touches without blocking them. So you basically receive all touches check if they are near the lower edge of the screen, if yes set a timer for a half a second and if during this timer is running applicationWillResignActive is called you can be almost certain that ControlCenter is opened. The time has to vary if there's no statusbar, because then the app is in fullscreen and it can take the user up to 3 seconds to launch Control Center.]
Hope it would help you figure out the exact solution to your problem.

App to detect when pause/play button is pressed

So I have been struggling for quite sometime trying to figure out how to have my app detect if the pause/play button was pressed to which I have a counter (uilabel) on my app to add and subtract when the play/pause button is pressed on the headset.
To clarify more , what I am trying to do is once my application detects the pause button on my headphones , it will then add one to my uilabel.. so the pause button would be assigned as a +1 controller for the label
My app does not have any multimedia or background loops as it is not intended for this purpose. I attempted to use the "UIEventTypeRemoteControl" with no luck since its technically not a remote. Any help would be greatly appreciated regarding this! Thank you

How to handle keyboard mic button event on iPhone

I have this UISearchBar sits on top of self.view. With the default keyboard shown when it became first responder, I wonder if there's any way to pick up a touch event of the microphone button. Any help would be greatly appreciated.
You are viewing this microphone icon because your iPhone dictation is switched on under Settings>General>Keyboard>Dictation or Settings-->General-->Siri.
I think you can use text input mode to identify which input mode is currently going on.
UITextInputCurrentInputModeDidChangeNotification
Reference - https://developer.apple.com/documentation/uikit/uitextinputmode?language=objc

iOS remote control - disable next and previous song buttons

I'm writing a streaming app that's using the remote control feature (remoteControlReceivedWithEvent:).
I can start and stop songs with the remote control as expected.
But I can't seem find out how to disable the next and previous song button on the home screen (double-tap home and swipe all the way to the left).
I'm using a MPMoviePlayerController internally.
Thanks :)
As far as I know the API doesn't allow you to show the buttons as disabled. I think the best you can do is just not take any action when one of those buttons are pressed.
I have not observed any other major app that shows the remote buttons as disabled.

Resources