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

Overview

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.

Comments
  • chore(deps): bump metcalfc/changelog-generator from 1.0.0 to 2.0.0

    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
    dependencies 
    opened by dependabot[bot] 1
  • chore(deps): bump metcalfc/changelog-generator from 1.0.0 to 1.0.1

    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
    dependencies 
    opened by dependabot[bot] 1
  • feat: allow any view to be dropped

    feat: allow any view to be dropped

    Up to 1.0.1, you could only ever use DropViews with the custom overlay mechanics. Starting with 1.1.0 you can now use whatever View you want, getting positioning, transitions, animations and drag gesture behavior for free.

    opened by sbertix 0
  • fix: add padding on unbalanced leading/trailing

    fix: add padding on unbalanced leading/trailing

    Fixed

    A regression in 1.0.0 meant if you were only adding one between leading and trailing, you would not get content centered correctly.

    Other

    Pull request Action now triggers less often, and Push uses a new release generator.

    opened by sbertix 0
  • feat!: upgrade flow following modern SwiftUI

    feat!: upgrade flow following modern SwiftUI

    • 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
    opened by sbertix 0
  • Commisery-action has been migrated towards `tomtom-internal`

    Commisery-action has been migrated towards `tomtom-internal`

    • [x] I've searched past issues and I couldn't find reference to this.

    Describe the bug Currently, you are using KevinDeJong-TomTom/commisery-action for your conventional commit message checks. We have been working diligently to improve this GitHub Action and, as result, also found a formal new location for this to be hosted: https://github.com/tomtom-international/commisery-action

    It might be beneficial to update to the latest release as it contains several new features (i.e. extended configurability, the ability to release a new GitHub Release based on the Conventional Commit types, et al.), and significantly decreased execution time (as we are no longer dependent on Python and Python-related modules)

    Any maintenance effort (incl security concerns) will ONLY be addressed in this new repository.

    I hope that I have sufficiently informed you of our decision (and recommendation). Feel free to reach out to me in case you have more questions/concerns!

    opened by KevinDeJong-TomTom 0
  • chore(deps): bump actions/checkout from 2 to 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
    dependencies 
    opened by dependabot[bot] 0
  • chore(deps): bump metcalfc/changelog-generator from 1.0.0 to 3.0.0

    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
    dependencies 
    opened by dependabot[bot] 0
Releases(1.1.0)
Owner
Stefano Bertagno
iOS developer
Stefano Bertagno
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
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

Elai Zuberman 1.1k Dec 29, 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
🚨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

Sofiane Beors 70 Nov 20, 2022
ActionBee is a programmable pasteboard action trigger.

ActionBee ActionBee is a programmable pasteboard action trigger. Preview Video It can be used to clean your URL in text. To see code or import this mo

Derek Jones 2 Aug 24, 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
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

Jovins 11 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

null 3 Jun 3, 2021
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

null 37 Dec 9, 2022
BeautyAlert - BeautyAlert provides alerts with custom shapes, colors, buttons

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

chacha 17 Sep 8, 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
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.

Wouter 63 Jan 5, 2023
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

HyperRedink 3.7k Dec 25, 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
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

Hemang 109 Jun 24, 2022
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

Takuya Okamoto 581 Dec 2, 2022
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

Luca Becchetti 438 Nov 20, 2022
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

Jakub Florek 43 Dec 29, 2022
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

Ivan Vorobei 1.4k Dec 10, 2021