how to distinguish on iOS volume button clicked from setting it by a software - ios

Is there any way to distinguish in the iOS app a situation that someone have changed volume by hardware buttons on iPhone/iPad from the situation that it has been done by some UI control in the app?
I have searched for that and so far I came up with many ways to be notified that the volume has been changed but there is no way to find out whether it was done by the UI control or hardware buttons. Notifications include info abut a reason of change but it is the same for both situations.

After a long search I came up with this:
There is no way to detect hardware button been pressed (so far iOS 7). You can only be informed with the result - volume changed. It means that the only solution will be to properly handle situation when the volume change is triggered by some UI component.

You might want to have a look at the private API. rpetrich did some research again.. :) click here
But you need to know that this is not really a good idea because apple probably will reject your app when accessing private apis.

Related

Creating a "Slide to power off" like slider on iOS

I'm trying to create a slider like this:
Is there a UI Element I can use in order to achieve this? Or another way?
No, there is no direct UIElement available which will give the desired effect.
If you plan to release the app on AppStore I would suggest do not try to replicate slide to unlock / power off.
I had a app rejected exactly for this reason. Following is the rejection reason as given by Apple.
Specifically, the Slide to Start element is not appropriate
and not in compliance with the App Store Review Guidelines as it is
too similar to the iOS Slide to Unlock UI. While we understand this
specific UI element is not present in the current version of iOS, it
is still not appropriate to include it in your app.
I had this same UIElement approved in an earlier version but got rejected during an update. So there is a small chance it gets over looked.

iPhone's Tone Color Change from an App

Recently, I have installed Twilight on my Android phone. Apparently is adds a color tone effect on the screen. Here are two screen shots taken from PlayStore.
Now my question is that is there a way to develop similar system display tone color set up application in iOS?
It is not possible as Apple restrict the developers to edit home screen. There are very limited features that we can access like Calendar, Gallery, etc. The above screenshot your are showing is related to Widget but there are no Widget concept in iOS.
Yes, it is certainly possible and I use an app that does this.
Have a look at https://github.com/anthonya1999/GoodNight, It's even open sourced.
However an app like this will most likely be denied from the App Store, but never the less it is possible.
Night Shift is supposed to bring something like this in iOS 9.3, though not to that extent.
I don't know of any public API that would allow an application to change that kind of parameter system-wise, though. Maybe in the Accessibility framework, but that would restrict it to app-wise, not system-wise.

UIAccessibilityTraitAllowsDirectInteraction and VoiceOver: issue or bug in iOS?

This is a quite strange behavior that 'persecutes' me since iOS 7.0 :) I hope someone of you can help me this time! As you probably know when you are using VoiceOver your gestures are totally different from the 'normal way'. When you need to bypass VoiceOver for a specific view you can set its accessibility traits as UIAccessibilityTraitAllowsDirectInteraction. When the view has this parameter set the user can interact with it as usual (like VoiceOver is not active in that particular view).
Quite often happens that this ability is randomly lost so VoiceOver acts in its normal way.
Did anyone of you encounter this problem in its experience? Did he solve it? Fortunately turning off and on VO seems to temporarily solve this issue (until next time it happens again)
Any idea? Thank you very much
I've seen this with other things as well. For example, notifications can be spotty, particular Screen Changed or Content Changed notifications. I believe this happens as a result of turning VoiceOver on and off. For example, if you were to turn VoiceOver on, leave it running, and open your application as a user would, you would never experience these issues.
However, if you use the VoiceOver shortcut. Or interrupt the application, re-install, and restart while using Xcode, you can disrupt the VoiceOver's connection to the application. It doesn't bond correctly. So, simple things like navigation work fine. But advanced features like notifications (and perhaps some of the more complicated traits) don't work.
Essentially, I would classify this as a bug, but a bug that only shows itself when you use VoiceOver in a way that only a developer would use it.

Can an iOS app interfere with the ipad keyboard?

I ve been getting some reviews on my app about a freeze on the right side of iPad keyboard. I did not even know that could be possible?
Does anyone experienced anything similar?
Any help on this keyboard freeze problem would be really appreciated cause I m little bit lost.
The "right side" of the keyboard is probably a red herring.
There are only two ways you could interfere with keyboard input:
Your input field is rejecting certain characters, but not giving user feedback that you're rejecting them.
You are doing some long-running work on the main thread (like downloading data, reading to/writing from disk, etc.) If this is the case, move it to a background thread.
No it's not readily possible from what I know, due to the strict permissions of the iPad and apple in general it would not be possible for an app to do this without you intentionally "hacking" the iPad. The only thing i could suggest is that the users are downloading malware to the iPad unwittingly through the site that you have made your app available ??

How to make a slider volume controller on iOS? Objective-C, iOS 7 (or 8), xcode 5 (or 6)

I am learning to develop iphone apps and I have a simple question.
I am making a really simple app which allows the user to set the volume of the device on the settings screen using a slider instead of the volume buttons.
It may be quite obvious for experienced developers but I just can't find the answer I am looking for.
My question is:
How can I make this slider?
Basically I want to do this (image: https://www.dropbox.com/s/b81bzdwyrab0ha7/slider.png?dl=0):
I used to think that I could use a regular UISlider but some documentation says that I need to use something called a MPVolumeView. The problem is that I can´t find a good tutorial that tells how to use this explicity.
I found this link on the apple documentation but I dont understand how this works. – http://developer.apple.com/iphone/library/documentation/MediaPlayer/Reference/MPVolumeView_Class/Reference/Reference.html
And the description says: Use a volume view to present the user with a slider control for setting the system audio output volume, and a button for choosing the audio output route. When first displayed, the slider’s position reflects the current system audio output volume. As the user drags the slider, the changes update the volume. If the user presses the device volume buttons while sound is playing, the slider moves to reflect the new volume.
This is exactly what I want but I dont understand the example it gives. If you could please tell me how t make this slider work, even if it is on a new one-view project, I would really appreciate it.
Also I am aware that this method also creates an airPlay button next to the volume slider. Is there a way to delete this button? (My app is a simple productivity app so I only want the slider, not the airplay button).
I also understand that this will not work on the simulator. How am I supposed to know that this will work without having to test it on an actual device (I am not registered as a developer yet)?
Plus, I only know objective-c, not swift. If you could please restrain from using swift in your answers I would apreaciate.
Thank you so much for your help.
PD: English is not my first language. Sorry for any mistakes I made.
The MPVolumeView class is designed to let you do exactly this. It's in MediaPlayer.framework, so add that to your app to make things build correctly.
You create it and make it visible the way you instantiate any other subclass of UIView, which you probably know by now.
You disable the routing button by setting the "showsRoutingButton" property to false.
"How am I supposed to know that this will work without having to test it on an actual device?"
By seeing that it's been there since iOS 2.0, and is used in countless apps?
The process to writing such a slider is incredibly simple, look into UISlider(https://developer.apple.com/library/ios/documentation/UIKit/Reference/UISlider_Class/) and then use the float value from the slider to set the volume.
If you do not want to write your own slider, look on GitHub(github.com) for controls that do this for you. After doing a quick search, I found this UISlidersubclass that adjusts volume.

Resources