https://github.com/3sidedcube/cubetoast-ios
Lightweight Swift Package for Android-style toast notifications on iOS (UIKit & SwiftUI compatible)
https://github.com/3sidedcube/cubetoast-ios
Last synced: 23 days ago
JSON representation
Lightweight Swift Package for Android-style toast notifications on iOS (UIKit & SwiftUI compatible)
- Host: GitHub
- URL: https://github.com/3sidedcube/cubetoast-ios
- Owner: 3sidedcube
- License: mit
- Created: 2025-06-02T10:31:27.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2026-03-12T16:08:54.000Z (5 months ago)
- Last Synced: 2026-03-12T22:38:28.948Z (5 months ago)
- Language: Swift
- Size: 23.4 KB
- Stars: 0
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
Lightweight Swift Package for toasts. Spiritual successor to MessageStackView.
## SwiftUI
```
struct ContentView: View {
@State private var toast: Toast?
var body: some View {
Button("Show toast") {
toast = Toast(image: .sfSymbol("checkmark"), text: "Saved!")
}
.toast($toast)
}
}
```
## UIKit
```
let toastContainer = ToastContainerView()
view.addSubview(toastContainer)
NSLayoutConstraint.activate([
toastContainer.leadingAnchor.constraint(equalTo: view.leadingAnchor),
toastContainer.trailingAnchor.constraint(equalTo: view.trailingAnchor),
toastContainer.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor)
])
toastContainer.show(Toast(image: .sfSymbol("checkmark"), text: "Saved!"))