---
title: "#79: Static Shortcut Items 📌"
url: https://littlebitesofcocoa.com/79-static-shortcut-items
author: Jake Marsh
published: 2015-09-10
topics: ["3D Touch","UIKit"]
description: "Shortcut Items were introduced with the announcement of 3D Touch on iPhone 6S and iPhone 6S Plus. They allow users to quickly jump to a particular section..."
---

# #79: Static Shortcut Items 📌

By Jake Marsh, September 10, 2015. HTML: https://littlebitesofcocoa.com/79-static-shortcut-items

_Shortcut Items_ were introduced with the announcement of **3D Touch** on **iPhone 6S** and **iPhone 6S Plus**. They allow users to quickly jump to a particular section or feature of an app, straight from the **home screen**.

_Shortcut Items_ come in two forms: **Static**, and **Dynamic**. **Static shortcut items** live in the **Info.plist** of our project. **Dynamic shortcut items** are defined in code, and configured at run time. Let's take a look at how to implement **static shortcut items**.

The first step is to configure the shortcut items in our Info.plist file:

<img src="https://media.littlebitesofcocoa.com/bite-assets/079-static-shortcut-items-infoplist.png" style="max-width: 594px;" />

Then, we need to implement one new **function** on our **app delegate**. We're using [JLRoutes](http://git.io/routes) here (covered in [Bite #62](/62)) to run some code when a given **URL** is passed in.

Then we'll call the provided `completionHandler`, with a `Bool` indicating whether we were able to handle the **item**.

``` swift
func application(application: UIApplication, performActionForShortcutItem shortcutItem: UIApplicationShortcutItem, completionHandler: Bool -> Void) {
  let url = NSURL(string: shortcutItem.userInfo["url"])!

  let didHandle = JLRoutes.routeURL(url)

  completionHandler(didHandle)
}
```

**Note:** At publish time of this Bite, **Xcode** did not offer a way to test **shortcut items** in the **Simulator.** To test **shortcut items'** functionality, [this project](https://github.com/DeskConnect/SBShortcutMenuSimulator) by [Conrad Kramer](https://github.com/conradev) was used.

**UPDATE:** We covered _Dynamic Shortcut Items_ in [Bite #88](https://littlebitesofcocoa.com/88). Head there to read about how to modify an **app's** **shortcut items** in code, at runtime.
