iosswiftuiapplicationswift4.2uiapplicationshortcutitem

UIApplicationShortcutItem not showing base on Info.plist


I have 5 items defined in my plist. It only showed 4. 🤦🏻‍♂️

I've tried in Simulator and the actual iPhone XS Max.

    <array>
        <dict>
            <key>UIApplicationShortcutItemIconFile</key>
            <string>home</string>
            <key>UIApplicationShortcutItemTitle</key>
            <string>Home</string>
            <key>UIApplicationShortcutItemType</key>
            <string>homePressed</string>
        </dict>
        <dict>
            <key>UIApplicationShortcutItemIconFile</key>
            <string>security</string>
            <key>UIApplicationShortcutItemTitle</key>
            <string>Security</string>
            <key>UIApplicationShortcutItemType</key>
            <string>securityPressed</string>
        </dict>
        <dict>
            <key>UIApplicationShortcutItemIconFile</key>
            <string>alert</string>
            <key>UIApplicationShortcutItemTitle</key>
            <string>Alert</string>
            <key>UIApplicationShortcutItemType</key>
            <string>alertPressed</string>
        </dict>
        <dict>
            <key>UIApplicationShortcutItemIconFile</key>
            <string>network</string>
            <key>UIApplicationShortcutItemTitle</key>
            <string>Network</string>
            <key>UIApplicationShortcutItemType</key>
            <string>networkPressed</string>
        </dict>
        <dict>
            <key>UIApplicationShortcutItemIconFile</key>
            <string>settings</string>
            <key>UIApplicationShortcutItemTitle</key>
            <string>Settings</string>
            <key>UIApplicationShortcutItemType</key>
            <string>settingsPressed</string>
        </dict>
    </array>

Result

enter image description here

Am I doing anything wrong ?


Solution

  • According to Apple:

    The system limits the number of quick actions displayed when a user presses a Home screen app icon. Within the limited set of displayed quick action titles, your static quick actions are shown first, starting at the topmost position in the list. If your static items do not consume the permissible number for display and you have also defined dynamic quick actions using this class, then one or more of your dynamic quick actions is displayed.

    That is, the system dictates the maximum number of items displayed and picks the first n items you provide for display.

    I can't find anywhere the exact limit is shown, but I havn't seen any app have more than 4 items + the "share" item.