A simple lightweight framework to present toasts in SwiftUI and UIKit.
- Toasts are overlayed on top of the existing view - they are not user interactable.
- Each toast automatically dismisses after 2 seconds.
- A new toast is not presented while the previous one is visible.
As per the latest update,
Liquidtoasts are only supported with Dynamic Island devices on Portrait orientation.Droptoasts are supported with both Notch and Dynamic Island devices.- Only
GlassandSolidtoasts are supported with landscape orientation.
There are 4 types of Toasts that can be presented: Liquid, Drop, Glass and Solid
import SwiftUI
import ToastKit
struct ExampleView: View {
var body: some View {
Button(action: {
ToastKit.present(message: "Some cool message", color: Color.yellow) // Step 2
}, label: {
Text("Present Toast")
})
.onAppear {
ToastKit.configure(type: .glass) // Step 1
}
}
}
#Preview {
ExampleView()
}Usman Nazir