Avatar

stelabouras

On iOS home screen shortcut items

Sunday, June 30, 2024

How many times have you tried accessing the settings of an iOS application on your device, but just the thought of scrolling through this really long list of installed applications in the Settings app makes you abandon all hope?

Maybe I am the only one answering positively to the above rhetorical question, but I am surprised that this particular user experience still feels like a chore.

Although I haven't been using Android as much as I do iOS, I find it really easy that on Android you can access the application settings (called "App info") just by long tapping on the application icon on the Android home screen.

The App info option when long tapping on an Android application

It's so liberating that it made me wonder why there is no such option on iOS, when force-tapping on an application icon on the iOS Home Screen.

Fortunately, UIKit provides us with the APIs necessary in order to build such an interaction ourselves. So below you can find a simple way to implement this interaction in the applications you develop (I had to clarify that so that the post doesn't read like an end-user guide where anyone can 'hack' the iOS to do something it cannot).

There are only three key components we need in order to build this kind of interaction:

  • The shortcutItems 1 property (iOS 9.0+), that allows us to define custom home screen shortcuts programmatically.
  • The openSettingsURLString 2 (iOS 8.0+) and openNotificationSettingsURLString 3 (iOS 16.0+) properties, that allows us to navigate to the respective view of the native Settings application.
  • The gear (iOS 13.0+) and bell.badge (iOS 14.0+) SF Symbols 4, allowing us to set the proper icon to those shortcuts that 100% match the iOS style.

Based on the above, if we only want to provide a shortcut to the main settings of the application, the application can just target iOS 13.0+ but if we also want to provide a separate shortcut to the notification settings, then the application must target iOS 16.0+. In any case, given that the iOS 18.0 release is just around the corner, I don't think this is a limiting factor.

Using those components, I have created a simple Swift sample application on GitHub that showcases this interaction, producing the following contextual menu when force-tapping the application icon on the iOS Home Screen:

The new home shortcuts implemented using the APIs mentioned in this blogpost

I will start implementing this interaction to my released applications soon, as I find it really helpful to be able to access the application's settings and notification views with just one tap!

Some (minor) caveats:

  • As I have already mentioned, this has to be implemented by the developer of each application separately, so there is a cost associated to that.
  • If the application is installed but never launched, those shortcuts will not be available to the user.
  • There are some rare cases where even though the shortcut is processed by the logic and the Settings application is launched, the application settings view is not pushed at all.