---
title: "#160: In-App Notifications with Whisper 📢"
url: https://littlebitesofcocoa.com/160-in-app-notifications-with-whisper
author: Jake Marsh
published: 2016-01-01
topics: ["Libraries","UIKit"]
description: "It's quite common to need to display short status messages or notifications inside our apps. Today we'll look at a library called Whisper that is absolutely..."
---

# #160: In-App Notifications with Whisper 📢

By Jake Marsh, January 1, 2016. HTML: https://littlebitesofcocoa.com/160-in-app-notifications-with-whisper

It's quite common to need to display short status messages or notifications inside our **apps**. Today we'll look at a library called [Whisper](https://github.com/hyperoslo/Whisper) that is <i>absolutely packed</i> with features that make displaying these types of messages both simple and beautiful. Let's dive in.

[Whisper](https://github.com/hyperoslo/Whisper) provides 3 different types of display styles. All allow for extensive customization including **colors**, **fonts**, etc.

First up is "Whispering" a **Message**:

<img src='https://media.littlebitesofcocoa.com/bite-assets/160-in-app-notifications-with-whisper-message.png' style='max-width: 375px;' />

``` swift
let message = Message(
  title: "🚨 Imperial Troops Have Entered the Base!",
  color: .redColor()
)

Whisper(message, to: navigationController, action: .Present)
Silent(navigationController, after: 3)
```

We call the **Silent** **function** right after we present the **Whisper**, this will dismiss the message after 3 seconds.

Next, let's try "Shouting" an **Announcement**.

<img src='https://media.littlebitesofcocoa.com/bite-assets/160-in-app-notifications-with-whisper-announcement.png' style='max-width: 375px;' />

This one's great for longer **text**, and looks great with an **image**. We can also pass in an **closure** to run when the user  taps the banner.

``` swift
let announcement = Announcement(
  title: "Han Solo Says:",
  subtitle: "Who's scruffy lookin'?!",
  image: UIImage(named: "avatar")
)

Shout(announcement, to: self)
```

Lastly, we can "Whistle" a **Murmur** to display a subtle, classy message in the **status bar**:

``` swift
let murmur = Murmur(title: "The last transport... is away! 🚀", backgroundColor: murmurColor)
Whistle(murmur)
```

<img src='https://media.littlebitesofcocoa.com/bite-assets/160-in-app-notifications-with-whisper-murmur.png' style='max-width: 375px;' />

More info about _Whisper_ can be found at [git.io/whisper](http://git.io/whisper)
