A µFramework for showing alerts like the one used when copying from pasteboard
Drops
A µFramework for showing alerts like the one used when copying from pasteboard or connecting Apple pencil.
Features
- iOS 11+
- Can be used in SwiftUI and UIKit applications
- Light/Dark modes
- Interactive dismissal
- Queue to show consecutive drops
- Support dynamic font sizing
- Support announcing title and subtitle via VoiceOver
- Show from top or bottom of screen
Usage
-
Create a drop:
let drop = Drop(title: "Title", subtitle: "Subtitle")
-
Show it:
Drops.show(drop)
Read the docs for more usage options.
Example Projects
- Run the
SwiftUIExample
target to see how Drops works in SwiftUI applications. - Run the
UIKitExample
target to see how Drops works in UIKit applications.
Installation
Swift Package Manager
The Swift Package Manager is a tool for managing the distribution of Swift code.
-
Add the following to your
Package.swift
file:dependencies: [
.package(url: "https://github.com/omaralbeik/Drops.git", from: "0.6.0")
] -
Build your project:
$ swift build
Manually
Add the Sources folder to your Xcode project.