elizavetaios/dialoggy
**Dialoggy** is a lightweight and flexible SwiftUI library for displaying custom dialogs in iOS apps.
β¨ Features
- Fully customizable buttons, fonts, and colors
- Easy to integrate via
.dialogable()modifier - Supports multiple actions
- Optional icon/image support
- iOS 17+ compatibility
πΊ Preview
<p float="left"> <img src="dialoggy-preview.gif" width="200" alt="Dialoggy preview 1" /> <img src="dialoggy-preview2.gif" width="200" alt="Dialoggy preview 2" /> </p>
π Installation
Swift Package Manager
Add Dialoggy to your Package.swift:
.package(url: "https://github.com/yourname/Dialoggy.git", from: "1.0.4")Or via Xcode: File β Add Packagesβ¦ and paste the repo URL.
π§ͺ Usage Example
struct ContentView: View {
@State private var dialog: DialogModel?
var body: some View {
VStack {
Button("Show Dialog") {
dialog = DialogModel(
title: "Hello!",
message: "This is an example dialog.",
actions: [
DialogAction(title: "OK", style: .primary) {
dialog = nil
}
]
)
}
}
.dialog($dialog)
.dialogable(style: DialogStyleConfig.default)
}
}π¨ Customization
DialogStyleConfig(
primaryButtonStyle: DialogButtonStyle(
backgroundColor: .blue,
foregroundColor: .white,
cornerRadius: 10
),
secondaryButtonStyle: DialogButtonStyle(
backgroundColor: .gray.opacity(0.2),
foregroundColor: .black,
cornerRadius: 10
),
titleFont: .title2,
titleForegroundColor: .primary,
messageFont: .body,
messageForegroundColor: .secondary,
imageSize: CGSize(width: 64, height: 64)
)π Example
See Examples/DialoggyDemo.swift for a live demo with multiple configurations.
π License
MIT
Package Metadata
Repository: elizavetaios/dialoggy
Default branch: main
README: README.md