Skip to content
kmatzkaPublic

About

A simple SwiftUI Head Up Display (HUD).

Resources

Stars

11 stars

Watchers

1 watching

Forks

Latest commit

 

History

15 Commits

Folders and files

Repository files navigation

HUD

Head Up Display

An simple HUD overlay view accessible from any SwiftUI view.

  1. Add a .modifier(HUDViewModifier()) to your top level view in the WindowGroup() of your App.

  2. Create a @StateObject hudState = HUDState() in your App, and

  3. Inject hudState into the environment at your top level view with .environmentObject(hudState).

  4. Show a HUD from anywhere in the view hierarchy by using @EnvironmentObject var hudState: HUDState and calling hudState.show(content:).

HUDs can be dismissed by a tap or swipe-up gesture. Or auto close after hudState.autoClosureDelay seconds.

Author: klaus.h.matzka@gmail.com

License: MIT

Vienna/Austria/Europe, September 2023

About

A simple SwiftUI Head Up Display (HUD).

Resources

Stars

11 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages