Skip to content

Releases: dmytro-ipatii/Dovetail

Release list

v0.1.0

Choose a tag to compare

@dmytro-ipatii dmytro-ipatii released this 28 Oct 23:20
40aee73

The first release of Dovetail: modular SwiftUI building blocks for iOS apps. Each module ships as its own library product, so your app imports only what it needs.

New module: DovetailRouter

Navigation for SwiftUI that you trigger from code. Push screens and present sheets, full screen covers, custom modals, alerts and confirmation dialogs from anywhere in your view hierarchy.

  • DovetailRouterView wraps a flow and owns its NavigationStack and every presentation.
  • Router is the protocol your views and view models depend on: showScreen(_:content:), showModal, showAlert, showConfirmationDialog, and a dismiss method for each.
  • SegueOption sets how a screen is presented: .push, .sheet or .fullScreenCover.
  • AlertContent, ConfirmationDialogContent and ButtonContent describe alerts and dialogs, with a text or custom-view message.
  • @Environment(\.dovetailRouter) gives nested views the router without passing it down.
  • MockRouter is a router that does nothing, for previews and tests.
import DovetailRouter

@main
struct MyApp: App {
    var body: some Scene {
        WindowGroup {
            DovetailRouterView { router in
                HomeView(router: router)
            }
        }
    }
}

// Each new screen gets its own router.
router.showScreen(.push) { router in
    DetailView(router: router)
}

router.showAlert(content: AlertContent(
    title: "Delete item?",
    message: "This can't be undone.",
    actions: [
        ButtonContent(label: "Cancel", role: .cancel) {},
        ButtonContent(label: "Delete", role: .destructive) { deleteItem() }
    ]
))

Installation

.package(url: "https://github.com/dmytro-ipatii/Dovetail.git", from: "0.1.0")

Then add the DovetailRouter product to your target. In Xcode, go to File → Add Package Dependencies… and tick only the products you need.

Requirements

  • iOS 18+
  • Swift 6.0+ (Xcode 16+)

Notes

This is a 0.x release, so the API may change between minor versions until 1.0. Bug reports, ideas and contributions are welcome. See CONTRIBUTING.md.

Full changelog: CHANGELOG.md