DropView - A SwiftUI library to display Apple Pencil and Pasteboard-like alerts on iOS.

Last update: Feb 5, 2022

Notification


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


What are some features I can expect from this library?

  • Dark mode
  • Interactive dismissal
  • Dynamic font sizing
  • Accessibility support
  • Custom positioning (.top, .bottom and .center)

Status

Swift iOS macOS tvOS watchOS
checks GitHub release (latest by date)

You can find all changelogs directly under every release.

What's next?

Milestones and issues are the best way to keep updated with active developement.

Feel free to contribute by sending a pull request. Just remember to refer to our guidelines and Code of Conduct beforehand.

Installation

Swift Package Manager (Xcode 11 and above)

  1. Select File/Swift Packages/Add Package Dependency… from the menu.
  2. Paste https://github.com/sbertix/DropView.git.
  3. Follow the steps.
  4. Add DropView.

Why not CocoaPods, or Carthage, or blank?

Supporting multiple dependency managers makes maintaining a library exponentially more complicated and time consuming.
Furthermore, with the integration of the Swift Package Manager in Xcode 11 and greater, we expect the need for alternative solutions to fade quickly.

Usage

DropView allows you to present alerts just like sheets and fullScreenCovers.

Just call .drop($drop) on any View.

Example

import SwiftUI

import DropView

struct YourView: View {
    /// An optional `Drop` binding.
    @State var drop: Drop?
    /// The current posiiton.
    @State var alignmentValue: Int = 0
    /// Autohides after a given amount of seconds.
    @State var seconds: TimeInterval = 2

    /// The vertical alignment.
    private var alignment: VerticalAlignment {
        switch alignmentValue {
        case 1: return .center
        case 2: return .bottom
        default: return .top
        }
    }

    /// The underlying view.
    var body: some View {
        VStack(spacing: 8) {
            Slider(value: $seconds, in: 2...10)
                .padding(.horizontal)
            Picker("Alignment", selection: $alignmentValue) {
                Text("Top").tag(0)
                Text("Center").tag(1)
                Text("Bottom").tag(2)
            }
            Button(action: {
                drop = .init(title: "DropView",
                             subtitle: "github.com/sbertix/DropView",
                             icon: Image(systemName: "hand.wave.fill").resizable(),
                             action: Image(systemName: "star.circle.fill").resizable())
            }) {
                Text("Present").bold()
            }
            Button(action: {
                drop = nil
            }) {
                Text("Hide").foregroundColor(.red)
            }
        }
        .drop($drop, hidingAfter: seconds, alignment: alignment)
    }
}

Special thanks

Massive thanks to anyone contributing to omaralbeik/Drops for the inspiration.

GitHub

https://github.com/sbertix/DropView
You might also like...

SwiftEntryKit is a presentation library for iOS. It can be used to easily display overlays within your iOS apps.

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

May 18, 2022

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

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

Description πŸƒ Break the silence of your UI, whispering, shouting or whistling at it. Whisper is a component that will make the task of displaying mes

May 16, 2022

The easiest way to display highly customizable in app notification banners in iOS

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

May 17, 2022

Zingle – An alert will display underneath your UINavigationBar πŸŽ…

Zingle – An alert will display underneath your UINavigationBar πŸŽ…

Zingle Zingle – An alert will display underneath your UINavigationBar πŸŽ… πŸ’₯ Note: Zingle has a dependency to have a UINavigationController in your app

Apr 28, 2022

Animated alert library like Swarm app.

Animated alert library like Swarm app.

TKSwarmAlert Animation Tool for Alert like Swarm app. ScreenShot Installation CocoaPods You can use CocoaPods to install TKSwarmAlert by adding it to

Apr 18, 2022

Swift library to manage in app notification in swift language, like WhatsApp, Telegram, Frind, ecc.

Swift library to manage in app notification in swift language, like WhatsApp, Telegram, Frind, ecc.

InAppNotify - Manage in App notifications During develop of my app Frind, I needed to manage in app notifications like whatsapp or telegram, but i did

May 9, 2022

SwiftUI native-like onboarding sheets

SwiftUI native-like onboarding sheets

Welcome Sheet Welcome sheet for swiftUI enables incredibly easy way for creating onboarding screens, update notes, or whatever you imagine! The main i

May 14, 2022

Native alert from Apple Music & Feedback. Contains Done, Heart & Message and other presets. Support SwiftUI.

Native alert from Apple Music & Feedback. Contains Done, Heart & Message and other presets. Support SwiftUI.

SPAlert Popup from Apple Music & Feedback in AppStore. Contains Done, Heart, Error and other presets. Supports Dark Mode. I tried to recreate Apple's

Dec 10, 2021

This is an iOS control for selecting a date using UIDatePicker in an UIAlertController like manner

This is an iOS control for selecting a date using UIDatePicker in an UIAlertController like manner

RMDateSelectionViewController This framework allows you to select a date by presenting an action sheet. In addition, it allows you to add actions arro

Apr 25, 2022
Comments
  • 1. chore(deps): bump metcalfc/changelog-generator from 1.0.0 to 2.0.0

    • f0ba16b - refactor: update swiftlint configuration
    • fc909ad - ci(actions): update release automations
    • 0e6738e - chore(docs): update CODE_OF_CONDUCT.md
    • 911b109 - chore(docs): update CONTRIBUTING.md
    • ea54edd - chore: update .gitignore
    Reviewed by dependabot[bot] at 2021-10-25 10:14
  • 2. chore(deps): bump metcalfc/changelog-generator from 1.0.0 to 1.0.1

    • f0ba16b - refactor: update swiftlint configuration
    • fc909ad - ci(actions): update release automations
    • 0e6738e - chore(docs): update CODE_OF_CONDUCT.md
    • 911b109 - chore(docs): update CONTRIBUTING.md
    • ea54edd - chore: update .gitignore
    Reviewed by dependabot[bot] at 2021-10-12 10:12
  • 3. chore(deps): bump actions/checkout from 2 to 3

    • f0ba16b - refactor: update swiftlint configuration
    • fc909ad - ci(actions): update release automations
    • 0e6738e - chore(docs): update CODE_OF_CONDUCT.md
    • 911b109 - chore(docs): update CONTRIBUTING.md
    • ea54edd - chore: update .gitignore
    Reviewed by dependabot[bot] at 2022-03-02 10:13
  • 4. chore(deps): bump metcalfc/changelog-generator from 1.0.0 to 3.0.0

    • f0ba16b - refactor: update swiftlint configuration
    • fc909ad - ci(actions): update release automations
    • 0e6738e - chore(docs): update CODE_OF_CONDUCT.md
    • 911b109 - chore(docs): update CONTRIBUTING.md
    • ea54edd - chore: update .gitignore
    Reviewed by dependabot[bot] at 2021-11-23 10:11
Display Apple system-like self-hiding status alerts. It is well suited for notifying user without interrupting user flow in iOS-like way.
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

Apr 23, 2022
Create Apple-like alerts & toasts using SwiftUI
Create Apple-like alerts & toasts using SwiftUI

AlertToast-SwiftUI Present Apple-like alert & toast in SwiftUI ?? Example ?? Overview Currently in SwiftUI, the only way to inform the user about some

May 16, 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

May 8, 2022
🚨Use the iPhone X Notch to display alerts. 🚨
🚨Use the iPhone X Notch to display alerts. 🚨

NotchyAlert Prerequisites Xcode 9.x Swift 4.x iPhone X Simulator/Device Demo Installation Cocoapods To install NotchyAlert using Cocoapods, add the fo

May 9, 2021
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.
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

May 18, 2022
Bursts πŸ”₯ A Funny Framework is showing alerts, Have been Adapting Swift and SwiftUI

Bursts ?? A Funny Framework is showing alerts, Have been Adapting Swift and SwiftUI Features iOS 10+ Can be used in UIKit and SwiftUI applications Lig

Apr 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

Jun 3, 2021
Advance animated alerts for iOS written in Swift
Advance animated alerts for iOS written in Swift

LIHAlert LIHAlert provides animated banners for iOS. Updated to Swift 3 Demo Project The LIHAlert workspace contains a demo project, also used for dev

Jan 10, 2022
BeautyAlert - BeautyAlert provides alerts with custom shapes, colors, buttons
BeautyAlert - BeautyAlert provides alerts with custom shapes, colors, buttons

BeautyAlert helps you can easily design by determining the color, shape, and sha

Mar 17, 2022
An iOS library for SwiftUI to create draggable sheet experiences similar to iOS applications like Maps and Stocks.

An iOS library for SwiftUI to create draggable sheet experiences similar to iOS applications like Maps and Stocks.

Apr 23, 2022