Interactive notification pop-over (aka "Toast) modeled after the iOS AirPods and Apple Pencil indicator.

Related tags

Event Indicate
Overview

Demo

Twitter: @pkluz

Interactive notification pop-over (aka "Toast) modeled after the iOS AirPods and Apple Pencil indicator.

Installation

The recommended way is to use CocoaPods.

CocoaPods

To install Indicate for Swift 5.0+, include the following in your Podfile

pod 'IndicateKit', '~> 1.0.5'

Carthage

To integrate Indicate into your Xcode project using Carthage, specify it in your Cartfile:

github "pkluz/Indicate" ~> 1.0.5

Run carthage update to build the framework and drag the resulting Indicate.framework into your Xcode project.

How To

After adding the framework to your project, you need to import the module

import Indicate

Afterwards presenting an indicator is a three-step process.

  1. Define the content.
  2. Configure the presentation.
  3. Present the indicator on any view.

Here's an example:

// STEP 1: Define the content
let content = Indicate.Content(title: .init(value: "Hello World", alignment: .natural),
                               subtitle: .init(value: "Indicate", alignment: .natural),
                               attachment: .emoji(.init(value: "🌼", alignment: .natural)))

// STEP 2: Configure the presentation
let config = Indicate.Configuration()
    .with(tap: { controller in
        controller.dismiss()
    })

// STEP 3: Present the indicator
let controller = Indicate.PresentationController(content: content, configuration: config)
controller.present(in: view)

LICENSE

The MIT License (MIT)

Copyright (c) 2021 Philip Kluz ([email protected])

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

You might also like...
SwiftUI-compatible framework for building browser apps with WebAssembly and native apps for other platforms
SwiftUI-compatible framework for building browser apps with WebAssembly and native apps for other platforms

SwiftUI-compatible framework for building browser apps with WebAssembly At the moment Tokamak implements a very basic subset of SwiftUI. Its DOM rende

VueFlux is the architecture to manage state with unidirectional data flow for Swift, inspired by Vuex and Flux.
VueFlux is the architecture to manage state with unidirectional data flow for Swift, inspired by Vuex and Flux.

Unidirectional State Management Architecture for Swift - Inspired by Vuex and Flux Introduction VueFlux is the architecture to manage state with unidi

SwiftUI-compatible framework for building browser apps with WebAssembly and native apps for other platforms
SwiftUI-compatible framework for building browser apps with WebAssembly and native apps for other platforms

SwiftUI-compatible framework for building browser apps with WebAssembly At the moment Tokamak implements a very basic subset of SwiftUI. Its DOM rende

A simple and predictable state management library inspired by Flux + Elm + Redux.

A simple and predictable state management library inspired by Flux + Elm + Redux. Flywheel is built on top of Corotuines using the concepts of structured concurrency. At the core, lies the State Machine which is based on actor model.

Swift Apps in a Swoosh! A modern framework for creating iOS apps, inspired by Redux.
Swift Apps in a Swoosh! A modern framework for creating iOS apps, inspired by Redux.

Katana is a modern Swift framework for writing iOS applications' business logic that are testable and easy to reason about. Katana is strongly inspire

SwiftEventBus - A publish/subscribe EventBus optimized for iOS

Allows publish-subscribe-style communication between components without requiring the components to explicitly be aware of each other

EventBroadcaster is a lightweight event handler framework, written in swift for iOS, macOS, tvOS & watchOS applications.
EventBroadcaster is a lightweight event handler framework, written in swift for iOS, macOS, tvOS & watchOS applications.

EventBroadcaster is a lightweight event handler framework, written in swift for iOS, macOS, tvOS & watchOS applications.

A simple example of the VIPER architecture for iOS apps

Counter Counter is a simple app showing the basics of the VIPER architecture, a version of Uncle Bob’s Clean Architecture for iOS apps. Counter shows

🍞 An async waiting toast with basic toast. Inspired by facebook posting toast
🍞 An async waiting toast with basic toast. Inspired by facebook posting toast

AwaitToast 🍞 An async waiting toast with basic toast. Inspired by facebook posting toast. Introduction Usage Default let toast: Toast = Toast.default

Taking a string containing a csv file and split it into records (aka lines) containing fields of data (aka Array of SubStrings)

Swift .csv parser Taking a string containing a csv file and split it into records (aka lines) containing fields of data (aka Array of SubStrings). Par

DropView - A SwiftUI library to display Apple Pencil and Pasteboard-like alerts on iOS.
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.

🍞 Toast for Swift - Toaster Android-like toast with very simple interface
🍞 Toast for Swift - Toaster Android-like toast with very simple interface

Toaster Android-like toast with very simple interface. (formerly JLToast) Screenshots Features Queueing: Centralized toast center manages the toast qu

A µFramework for showing alerts like the one used when copying from pasteboard or connecting Apple pencil
A µFramework for showing alerts like the one used when copying from pasteboard or connecting Apple pencil

Drops 💧 A µFramework for showing alerts like the one used when copying from pasteboard or connecting Apple pencil. Features iOS 10+ Can be used in Sw

SSToastMessage is written purely in SwiftUI. It will add toast, alert, and floating message view over the top of any view. It is intended to be simple, lightweight, and easy to use. It will be a popup with a single line of code.
SSToastMessage is written purely in SwiftUI. It will add toast, alert, and floating message view over the top of any view. It is intended to be simple, lightweight, and easy to use. It will be a popup with a single line of code.

SSToastMessage SSToastMessage is written in SwiftUI. It will add toast, alert, and floating message view over the top of any view. It is intended to b

A modern iOS toast view that can fit your notification needs
A modern iOS toast view that can fit your notification needs

CRToast CRToast is a library that allows you to easily create notifications that appear on top of or by pushing out the status bar or navigation bar.

Recording Indicator Utility lets you turn off the orange microphone recording indicator light for live events and screencasts.
Recording Indicator Utility lets you turn off the orange microphone recording indicator light for live events and screencasts.

Recording Indicator Utility Recording Indicator Utility lets you turn off the orange microphone recording indicator light, making it ideal for profess

Floating indicator, mimicrate to indicator which appear when silent mode turn on / off. Support large texts.
Floating indicator, mimicrate to indicator which appear when silent mode turn on / off. Support large texts.

SPIndicator About Mimicrate to indicator which appear when silent mode turn on / off. Availalbe 2 animated presets: done & error. Also support custom

Navigation toolbar is a Swift slide-modeled UI navigation controller.
Navigation toolbar is a Swift slide-modeled UI navigation controller.

Navigation toolbar is a Swift slide-modeled UI navigation controller. We specialize in the designing and coding of custom UI for Mo

Control the listening mode on your AirPods Pro in the Touch Bar or Menu Bar.
Control the listening mode on your AirPods Pro in the Touch Bar or Menu Bar.

NoiseBuddy Change noise cancelling settings on your AirPods Pro or Beats Solo Pro directly from your Mac's Menu Bar or Touch Bar. I wanted an easier w

Comments
  • NavigationBar hides indicate

    NavigationBar hides indicate

    Hi @pkluz,

    First of all thank you for this clean and useful implementation. I really like it.

    Currently I tried to used it into controller which is embeded into Navigationcontroller and Indicate still hidden under navigationbar. Is it possible to fix that?

    Kind regards, Mabel

    opened by mabeljarsdel 1
  • Added new configuration options

    Added new configuration options

    Added new configuration options:

    • titleColor
    • subtitleColor
    • backgroundColor
    • titleFont
    • subtitleFont

    In case the options are not provided, falls back to the default values

    opened by jkrukowski 0
Releases(2.0.0)
Owner
Philip Kluz
Philip Kluz
UI event handling using Apple's combine framework.

Description Combinative is a library for UI event handling using Apple's combine framework. It doesn't need many dependencies because it is written ma

noppefoxwolf 106 Jan 29, 2022
Modern thread-safe and type-safe key-value observing for Swift and Objective-C

Now Archived and Forked PMKVObserver will not be maintained in this repository going forward. Please use, create issues on, and make PRs to the fork o

Postmates Inc. 708 Jun 29, 2022
Define and chain Closures with Inputs and Outputs

Closure Define and chain Closures with Inputs and Outputs Examples No Scoped State let noStateCount = Closure<String, String> { text in String(repea

Zach Eriksen 3 May 18, 2022
A Swift based Future/Promises Library for IOS and OS X.

FutureKit for Swift A Swift based Future/Promises Library for IOS and OS X. Note - The latest FutureKit is works 3.0 For Swift 2.x compatibility use v

null 759 Dec 2, 2022
Tempura - A holistic approach to iOS development, inspired by Redux and MVVM

Tempura is a holistic approach to iOS development, it borrows concepts from Redux (through Katana) and MVVM. ?? Installation Requirements CocoaPods ??

Bending Spoons 692 Dec 17, 2022
Very simple Observable and Publisher implementation for iOS apps.

Very simple Observable and Publisher implementation for iOS apps.

Igor Kulman 7 Jun 11, 2022
A New, Modern Reactive State Management Library for Swift and SwiftUI (The iOS implementation of Recoil)

RecoilSwift RecoilSwift is a lightweight & reactive swift state management library. RecoilSwift is a SwiftUI implementation of recoil.js which powered

Holly Li 160 Dec 25, 2022
Write great asynchronous code in Swift using futures and promises

BrightFutures How do you leverage the power of Swift to write great asynchronous code? BrightFutures is our answer. BrightFutures implements proven fu

Thomas Visser 1.9k Dec 20, 2022
A library for reactive and unidirectional Swift applications

ReactorKit is a framework for a reactive and unidirectional Swift application architecture. This repository introduces the basic concept of ReactorKit

ReactorKit 2.5k Dec 28, 2022
A micro-library for creating and observing events.

Signals Signals is a library for creating and observing events. It replaces delegates, actions and NSNotificationCenter with something much more power

Tuomas Artman 454 Dec 21, 2022