How do I detect a long press on the app icon? - ios

Is there a way to detect if the user has long-pressed the app icon on the home screen?
I can detect if a quick action is selected, but I'd also like to detect if the Home Screen Quick Action menu is displayed.

Is there a way to detect if the user has long-pressed the app icon on the home screen?
No. Cocoa is event driven. Without an event, your code doesn't run. You don’t get any event unless the user taps one your quick actions or Today extension.

Related

Button accesible from lock screen in iOS

I want to develop an iOS app that can have like a panic button when the screen is locked. This button can be enable or disabled within the app, but
I want to know if it is possible to add a very accessible button you can press in case of an emergency even when the screen is locked. When the button is pressed I want to execute some code in the app.
Is there a possible way of accomplishing this in iOS?
Or is there an alternative?, The only think that I required is that the button can be pressed like in maximum three seconds even if the screen is locked and the app closed.
No that is not possible in iOS. You cannot make changes outside of your app.
One suggestion i can give you is to make a extension for today view in notification center. And you can ask the users to touch the button in notification center to invoke your functionality.
Notification center can be accessed in lock screen also.

Can I make my iphone app use only a portion of the screen

I was hoping to create a small windowed screen when the home button is pressed. It would keep a portion of the app process open while another app isn't open.
So say I had music playing on the app and when the home button gets pressed the screen would be windowed or shrunk and just displayed over the main screen (kind of like the little help button that can be moved around). Would using widgets in IOS 8 work?
When the user presses the Home button, the app goes to background, and that's it. You can't customize that action.
You only get a notification that the user closed the app so that you can save your app state or data for the next launch.

How to add a view/gesture recognisers to iPhone/iPad home Screen

Until today I believed that it's impossible but there is an app is called Shou from the Emu4iOS Store that record your screen and even if the app is in background there is a view on home screen that on touch redirect you to the app. (please see attached image)
My Question is how can I achieve the same ? How can I add a view to Home screen ?
That's a status bar in a recording state. These are system defined states, such as the green bar you get while taking a call. These appear when an app is recording audio automatically, and there is no way to trigger it manually.
There is no way to add views and gesture recognizers on to the springboard.

Detecting home button press on iOS?

Is there any way to detect if the user has pressed the home button on iOS? Obviously if the app is running normally the app delegate methods gets called, but if the device is locked to an app (through Guided Access or an MDM-server) so the app doesn't quit when you push the home button - is there then any way to know if the user pushed it?
My initial thought was to listen for notifications, but I can't seem to see any generated by pressing the home button.
short:
no not on a stock idevice
longer:
on a stock device your best bet is UIApplicationDidEnterBackgroundNotification (Posted when the app enters the background.)
there is no dedicated way to listen for presses to the home button though, so this won't work for GuidedAccess either

How to replicate home button double tap effect on click of a button?

In IOS, when we double tap the home button, it lift's the current app and shows all the app that are running on the bottom. I can scroll the bottom and select the music player option from there. I want to achieve the same screen lift effect, when user taps a button from withing the app instead of double tapping the home button. Is it possible to that? If yes, how can we do it?
No the home button function (unless jailbroken) cannot be re-created inside your UI.
Also since iOS6 users can opt to have Guided Access enabled, if that button where to be created would be considered useless. Now that would be a pain to do in a de-bugging process.
You would have to access the Home Button API (if there was one) as well as the guided access API.

Resources