Whisper is a component that will make the task of display messages and in-app notifications simple. It has three different views inside

Overview

Whisper

CircleCI License Platform

Description 🍃

Break the silence of your UI, whispering, shouting or whistling at it. Whisper is a component that will make the task of displaying messages and in-app notifications simple. It has three different views inside.

Whispers

Whisper

Display a short message at the bottom of the navigation bar—this can be anything, from a "Great Job!" to an error message. It can have images or even a loader.

Shouts

In-App

Let users know that something happened inside the app with this beautiful customizable in-app notification.

Whistles

Whistle

This is the smallest of all, a beautiful discretion in your UI.

Bonus

All sounds are fully customizable, as are colors and fonts.

Shouts have an optional action that will be called if the user taps on it, and you'll even get a message when the Shout is gone. Finally, if you want to set how long the Shout should be displayed, you have a duration property.

In Whisper, there is no need to think about scroll view insets anymore—this will be handled automatically. As an added bonus, when transitioning from one view controller to another, the next controller's offset will be adjusted as you'd expect. It just works!

Usage

The usage of the component is so simple, you just create a message in the case of Whisper, an announcement in the case of a Shout, or a Murmur in the case of a Whistle. Because there may be a conflict with show from UIViewController, you need to explicitly use the Whisper namespace to call show.

For a Whisper:
let message = Message(title: "Enter your message here.", backgroundColor: .red)

// Show and hide a message after delay
Whisper.show(whisper: message, to: navigationController, action: .show)

// Present a permanent message
Whisper.show(whisper: message, to: navigationController, action: .present)

// Hide a message
Whisper.hide(whisperFrom: navigationController)
For a Shout:
let announcement = Announcement(title: "Your title", subtitle: "Your subtitle", image: UIImage(named: "avatar"))
Whisper.show(shout: announcement, to: navigationController, completion: {
  print("The shout was silent.")
})
For a Whistle:
let murmur = Murmur(title: "This is a small whistle...")

// Show and hide a message after delay
Whisper.show(whistle: murmur, action: .show(0.5))

// Present a permanent status bar message
Whisper.show(whistle: murmur, action: .present)

// Hide a message
Whisper.hide(whistleAfter: 3)

If you want to use Whisper with Objective-C, you can find information about it here.

Installation

Whisper is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'Whisper'

Whisper is also available through Carthage. To install just write into your Cartfile:

github "hyperoslo/Whisper"

Roadmap

In the future the idea is to keep improving and add some features:

  • Improve the offset detection and animation.
  • Add more UI related components into Whisper.
  • More customization points and more sizes for each whisper.
  • Custom actions inside Whispers and Shouts.
  • We are open to new and awesome ideas, contribute if you like! :)

Author

Hyper made this with ❤️

Contribute

We would love for you to contribute to Whisper, check the CONTRIBUTING file for more info.

License

Whisper is available under the MIT license. See the LICENSE file for more info.

Comments
  • Fix/shout

    Fix/shout

    • Rename free functions to lowercase first letter. This preserves Whisper namespace, and make ColorList, FontList, Config under namespace. 😈 THIS IS BREAKING CHANGES 👿
    • Allow Shout text to be 2 lines
    • Update layout to deal with when Shout image is nil or subtitle is empty

    simulator screen shot 13 may 2016 12 42 44 simulator screen shot 13 may 2016 13 22 42

    opened by onmyway133 15
  • issue with swift 4 & Xcode 9

    issue with swift 4 & Xcode 9

    Hi!

    Thank you for this wonderful library but I am having troubles with the migration to swift 4 from swift 3.

    I am using Xcode 9 and Whisper version 5.1.0 that comes with swift 4 support but when trying to run my project I have 16 issues regarding this library. All issues are the same_

    Argument of '#selector' refers to instance method 'orientation ... that is not exposed to Objective-C

    and

    'shared' is unavailable: Use view controller based solutions where appropriate instead

    Since I am seeing that this library is working with swift 4 what I am doing wrong?

    Thank you!

    opened by josmanperez 14
  • 'show' is getting confused with UIViewController show in swift3 branch

    'show' is getting confused with UIViewController show in swift3 branch

    The latest beta XCode is having issues with the show method. There is a show method on UIViewController that it keeps getting confused with. Not sure why it can't differentiate between the two but it can't.

    A better way of defining these methods might be the following:

    public func showAnnouncement(_ announcement: Announcement, to: UIViewController, completion: (() -> Void)? = nil)

    public func showMurmur(_ murmur: Murmur, action: WhistleAction = .show(1.5))

    public func showMessage(_ message: Message, to: UINavigationController, action: WhisperAction = .Show)

    Then you can leave the first label off when calling:

    showAnnouncement(announcementVar, to: self) showMurmur(murmurVar, .show(2.0)) showMessage(messageVar, to: self.navigationController, .Show(2.0))

    opened by bedaronco 13
  • Feature: add an activity notification, with progress bar

    Feature: add an activity notification, with progress bar

    Facebook uses a nice in-app banner when the user taps "Post". The user see a progress bar indicating the posting process, while at end, signalling it's done.

    Would be great if such one will be added to Whisper.

    enhancement 
    opened by oferRounds 13
  • Problem with TableView Insets

    Problem with TableView Insets

    Hi! I have two TableViewControllers as you can see in the video I've attached here. In the 2nd one I show a permanent Whisper notification (the only thing I've changed is the WhisperView height to 38). When the user press back, on viewWillDisappear() I invoke Silent(navigationController!) and the insets for the first TableViewControllers breaks. It returns top = -38 instead of top = 0.0, as my navigationBar is opaque, not transparent. The second time I do it, as you can see in the video, the insets becomes worst, because this time it returns top = -76, so 38 x 2. And it goes on and on. I have tried to solve this but couldn't exactly found the right line to modified in the pod. Hope you can help me! Thank you very much! Pablo movie

    opened by PabloLV 12
  • Whisper effect it's superview when it's called to show in viewDidLoad or viewDidAppear

    Whisper effect it's superview when it's called to show in viewDidLoad or viewDidAppear

    Hello, Merry X-Mas !

    I have a problem when I try to show Whisper at the functions viewDidLoad or viewDidAppear the tableview add strange space at it's top, please take a look in to the attached photo screen shot 2015-12-25 at 12 42 48 am

    if I show Whisper by using the button it work perfect.

    You could found this bug in my demo project : https://github.com/0x686169/NiceWhisper

    Hope you fix this soon as soon.

    Thank you very much,

    opened by haithngnbak 11
  • Whistle restart application without crashing

    Whistle restart application without crashing

    Hi, If I try to call a Murmur my application restart to the Initial View Controller.

    var murmur = Murmur(title: "Can you retry please?")
    Whistle(murmur) //Restart if this is not commented
    

    Same behavior with iPhone or simulator. Only tested with latest SDK iOS 9.2.0. Any idea?

    opened by VivienGiraud 7
  • Extended whisper background height to embrace the notch

    Extended whisper background height to embrace the notch

    Well, I guess there's no perfect solution, but what would you think of having the whistles display all the way from the top of the screen on the iPhone X?

    design proposal

    opened by gilserrap 6
  • Support Buttons

    Support Buttons

    In the current implementation Whisper has no intention to use buttons in the whisper. Is it possible to add buttons with different callbacks to manage this?

    enhancement help wanted 
    opened by mRs- 6
  • Whisper.show bug

    Whisper.show bug

    the setup is like this: when u click button A, it call Whisper.show

    If u click multiple time on that buttonA, ur screen will keep pushed up and it getting smaller

    opened by cwt2829 5
  • 🛠 Bug: terminating application

    🛠 Bug: terminating application

    You create new UIWindow in WhistleFactory() on 20nd line.

    It cause the application crash on didFinishLaunchingWithOptions methods because of followings in my opinion.

    http://stackoverflow.com/a/33958144/3022613

    2016-05-11 04:32:22.166 Smart Citizen[742:145841] *** Assertion failure in -[UIApplication _runWithMainScene:transitionContext:completion:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3512.60.7/UIApplication.m:3401
    2016-05-11 04:32:22.168 Smart Citizen[742:145841] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Application windows are expected to have a root view controller at the end of application launch'
    *** First throw call stack:
    (0x1834f2e38 0x182b57f80 0x1834f2d08 0x183e78124 0x1888e6ad0 0x1888e3674 0x184e937ac 0x184e93618 0x184e939c8 0x1834a9124 0x1834a8bb8 0x1834a68b8 0x1833d0d10 0x1886ab834 0x1886a5f70 0x1000ae594 0x182f6e8b8)
    libc++abi.dylib: terminating with uncaught exception of type NSException
    

    Can you provide any solution for this? Why do you need to create new UIWindow?

    BTW: Without Whisper pod everything works well, same AppDelegate.swift file.

    If you want to investigate problem I can share my project folder.

    opened by muhasturk 5
  • WhistleFactory whistleWindow not removed after display?

    WhistleFactory whistleWindow not removed after display?

    Is there a reason why the whistleWindow is not removed after displaying? It's causing issues in my code whenever I call UIApplication.shared.windows.first, which returns the whistleWindow and not the expected keyWindow.

    I forked the project and made whistleWindow an optional and I set it to nil when the display has finished.

    public func hide() {
        let finalOrigin = view.frame.origin.y - titleLabelHeight - Dimensions.notchHeight
        UIView.animate(withDuration: 0.2, animations: {
          self.whistleWindow?.frame.origin.y = finalOrigin
          }, completion: { _ in
            if let window = self.previousKeyWindow {
              window.isHidden = false
              self.whistleWindow = nil // Setting this to nil... Will this cause any problems?
              self.previousKeyWindow = nil
              window.rootViewController?.setNeedsStatusBarAppearanceUpdate()
            }
        })
      }
    

    Will this solution cause any problems?

    opened by JCsplash 0
  • Murmur text is overlapped by the iOS status bar text

    Murmur text is overlapped by the iOS status bar text

    Hi there,

    It's a great library. Thank you for your work.

    I am experiencing the following issue:

    When I display a Murmur the iOS status bar text is not overlapped by the Murmur text. It's kind of a merged info. I am using Xcode 12.0.1 and iPhone 8 device/simulator. Both iOS 13.7 and 14.0.1 produces the issue.

    It's happening in both Light and Dark mode. Please let me know if I am doing something wrong. Thanks!

    let murmur = Murmur(title: "Updating...", backgroundColor: .orange, titleColor: .white)
    Whisper.show(whistle: murmur, action: .present)
    

    dark

    light

    opened by viktoriakrasznai 2
  • SceneDelegate 不能出现

    SceneDelegate 不能出现

    swift5 iOS13之后,有SceneDelegate,导致Whisper `let murmur = Murmur(title: "This is a permanent whistle...", backgroundColor: UIColor.red, titleColor: UIColor.white)

        Whisper.show(whistle: murmur, action: .present)`
    

    失效,无法显示

    opened by kou8910 6
Releases(6.1.0)
  • 6.1.0(Jun 5, 2020)

  • 6.0.2(Nov 22, 2017)

  • 6.0.1(Nov 21, 2017)

    • Extended whisper background height to embrace the notch https://github.com/hyperoslo/Whisper/pull/193, by gilserrap

    🤘 Closed issues

    • issue with swift 4 & Xcode 9 https://github.com/hyperoslo/Whisper/issues/190
    • UITextField loses focus when a Whisper is called https://github.com/hyperoslo/Whisper/issues/189
    • Swift 4 Support https://github.com/hyperoslo/Whisper/issues/172
    • Use of unresolved identifier 'safeAreaInsets' https://github.com/hyperoslo/Whisper/issues/192
    Source code(tar.gz)
    Source code(zip)
  • 6.0.0(Oct 30, 2017)

    🚀 Merged pull requests

    • Swift4 https://github.com/hyperoslo/Whisper/pull/180, by majamusan
    • Add circle CI https://github.com/hyperoslo/Whisper/pull/184, by onmyway133
    • Update project to Swift 4 https://github.com/hyperoslo/Whisper/pull/185, by onmyway133
    • Fix some minor typos and grammar errors in README.md https://github.com/hyperoslo/Whisper/pull/187, by cmilr
    • Fixing keyboard visibility bug in WhistleFactory https://github.com/hyperoslo/Whisper/pull/186, by jondwillis
    • Refactor iPhone X fix https://github.com/hyperoslo/Whisper/pull/183, by zenangst
    • Swift 4 Support https://github.com/hyperoslo/Whisper/pull/175, by barnaclejive
    • Fixed incorrect displaying with iPhone X. https://github.com/hyperoslo/Whisper/pull/179, by wowlocal
    Source code(tar.gz)
    Source code(zip)
  • 5.1.0(Oct 18, 2017)

    🚀 Merged pull requests

    • Use correct window for makeKeyAndVisible https://github.com/hyperoslo/Whisper/pull/158, by plu
    • Removed the Team Identifier from the demo project https://github.com/hyperoslo/Whisper/pull/182, by JGiola

    🤘 Closed issues

    • Whistle restart application without crashing https://github.com/hyperoslo/Whisper/issues/68
    • How Whisper can be installed manually (without cocoapods etc)? https://github.com/hyperoslo/Whisper/issues/154
    • Feature: add keyboard input option as in the native Push banner https://github.com/hyperoslo/Whisper/issues/29
    • Hiding whisper breaks when used with other UIWindows (such as GoogleMobileAds). https://github.com/hyperoslo/Whisper/issues/156
    • Bug: Incorrect position of Whistle. https://github.com/hyperoslo/Whisper/issues/58
    • NavigationController Hide Announcement https://github.com/hyperoslo/Whisper/issues/162
    • Can't get Shout to work in Swift 3 https://github.com/hyperoslo/Whisper/issues/126
    • No Sound for shout in iOS 11 https://github.com/hyperoslo/Whisper/issues/174
    Source code(tar.gz)
    Source code(zip)
  • 5.0.0(Apr 18, 2017)

  • 4.0.0(Oct 13, 2016)

    The Swift 3 version of Whisper is here!

    This release also includes:

    • 2 lines of text in shouts! #102
    • Variable size shouts! #108

    Thanks to everyone to make this release possible. :)

    Source code(tar.gz)
    Source code(zip)
  • 3.1.1(Aug 5, 2016)

  • 3.1.0(Aug 1, 2016)

    • Fix strong reference https://github.com/hyperoslo/Whisper/pull/93
    • Rename global function https://github.com/hyperoslo/Whisper/pull/104
    • Fix duration parameter in calm https://github.com/hyperoslo/Whisper/pull/107
    Source code(tar.gz)
    Source code(zip)
  • 3.0.0(May 3, 2016)

    Permanent whistle: https://github.com/hyperoslo/Whisper/pull/83

    • duration property has been removed from Murmur;
    • Whistle function has new attribute action to show either temporary or permanent message;
    • Whistle message could be hidden with a new Calm function;
    • Action is renamed to WhisperAction
    Source code(tar.gz)
    Source code(zip)
  • 2.1(Mar 18, 2016)

  • 2.0.2(Jan 15, 2016)

  • 2.0.1(Jan 15, 2016)

  • 2.0.0(Jan 15, 2016)

    This version introduces a breaking change for the public API in Message's. The label color is now called backgroundColor.

    • Fixes Murmur's not using duration - #38, @duemunk
    • Fix Whistle messing with status bar appearance #39, @duemunk
    • Whispers now supports setting text color #44

    A special thanks goes out to @duemunk for smashing some bugs that had snuck itself into Whisper

    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(Jan 5, 2016)

    This release includes various fixes that you can find in the issues.

    • Shout now supports color.
    • Movement orientations improved.
    • Improved the encapsulation of some intern code.

    Special thank's to @burntheroad and @NachoSoto for their PRs, keep rocking! :)

    Source code(tar.gz)
    Source code(zip)
  • 1.0(Dec 16, 2015)

Owner
HyperRedink
Connected creativity
HyperRedink
💌 Easy to use and customizable messages/notifications for iOS à la Tweetbot

Notice: TSMessages is no longer being maintained/updated. We recommend everyone migrate to RMessage. This repository will be kept as is for those who

Felix Krause 4.9k Dec 31, 2022
It is a highly configurable iOS library which allows easy styling with built in styles as well as extra header and footer views so that you can make extremely unique alerts and action sheets.

 CFAlertViewController CFAlertViewController is a library that helps you display and customise Alerts, Action Sheets, and Notifications on iPad and i

Crowdfire Inc. 1.1k Dec 18, 2022
Simple Swift in-app notifications

LNRSimpleNotifications TSMessages is an amazingly powerful in-app notifications library but requires a lot of setup. LNRSimpleNotifications is a simpl

LISNR 203 Nov 20, 2022
Highly configurable iOS Alert Views with custom content views

NYAlertViewController NYAlertViewController is a replacement for UIAlertController/UIAlertView with support for content views and UI customization. Fe

Nealon Young 609 Nov 20, 2022
UIPicker inside a UIAlertController

DPPickerManager UIPicker inside a UIAlertController HOW TO USE : // Strings Picker let values = ["Value 1", "Value 2", "Value 3", "Value 4"] DPPickerM

Prioregroup.com 45 May 30, 2022
CoffeeToast - A swift package to easily add Toast notifications to your app

CoffeeToast A simple Swift package to add Toast Notifications to your app. Insta

Maegan Wilson 2 Feb 3, 2022
SwiftOverlays is a Swift GUI library for displaying various popups and notifications

SwiftOverlays is a Swift GUI library for displaying various popups and notifications. SwiftOverlays animated logo is kindly made by Crafted Pixels Fea

Peter Prokop 632 Dec 22, 2022
[iOS] Easy, customizable notifications displayed on top of the statusbar. With progress and activity. iPhone X ready.

JDStatusBarNotification Show messages on top of the status bar. Customizable colors, font and animation. Supports progress display and can show an act

M Emrich 3.8k Dec 27, 2022
A Swift extension that adds toast notifications to the UIView object class.

Toast-Swift Toast-Swift is a Swift extension that adds toast notifications to the UIView object class. It is intended to be simple, lightweight, and e

Charles Scalesse 3.3k Dec 22, 2022
Easily create different alerts in SwiftUI

AlertWizard ????‍♂️ This package lets you easily create different alerts in SwiftUI with the call of a single function. As this is my first package th

null 3 Jun 3, 2021
BottomSheet makes it easy to take advantage of the new UISheetPresentationController in SwiftUI with a simple .bottomSheet modifier on existing views.

BottomSheet makes it easy to take advantage of the new UISheetPresentationController in SwiftUI with a simple .bottomSheet modifier on existing views.

Adam Foot 341 Dec 15, 2022
The easiest way to display highly customizable in app notification banners in iOS

Written in Swift 5 NotificationBanner is an extremely customizable and lightweight library that makes the task of displaying in app notification banne

Dalton Hinterscher 4.5k Jan 9, 2023
Bottom Sheet component is widely used in Joom application

Bottom Sheet Bottom Sheet component is widely used in Joom application Installation Swift Package Manager Swift Package Manager is a tool for managing

Joom 101 Dec 29, 2022
BottomSheet Component 🧪🧪🧪

BCSComponent This Source code provide a bottom sheet which allow you custom own cell,you able to show it on the bottom sheet Get started First thing f

Kien Pham 3 Dec 1, 2022
iOS tweak to display toasts for Low Power alerts and charging

Electrode iOS tweak to display toasts for Low Power alerts and charging. Localization Want to help translate Electrode to your language? Sumbit a pull

null 8 Sep 7, 2022
DropView - A SwiftUI library to display Apple Pencil and Pasteboard-like alerts on iOS.

DropView is a SwiftUI-based library to display alerts inspired by the Apple Pencil and pasteboard stock ones.

Stefano Bertagno 46 Dec 4, 2022
(Experimental libraries) Controls interrupt handling, such as alert views, and is compatible with UIKit and Swift UI.

UIPresentCoordinator Controls interrupt handling, such as alert views, and is compatible with UIKit and Swift UI. This library manages items that are

Yuki Tamazawa 1 Jan 22, 2022
Display Apple system-like self-hiding status alerts. It is well suited for notifying user without interrupting user flow in iOS-like way.

StatusAlert is being sponsored by the following tool; please help to support us by takin a look and signing up to a free trial. Dependency managers Fe

Yehor Miroshnychenko 841 Dec 6, 2022
SwiftEntryKit is a presentation library for iOS. It can be used to easily display overlays within your iOS apps.

SwiftEntryKit ?? Donations can be made here. Table of Contents Overview Features Example Project Example Project Installation Presets Playground Requi

Daniel Huri 6.1k Jan 4, 2023