HUD: A Simple SwiftUI Head Up Display

HUD

Head Up Display

An simple HUD overlay view accessible from any SwiftUI view.

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

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

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

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.

ShowHUD.gif

Author: klaus.h.matzka@gmail.com

Vienna/Austria/Europe, 09-2023


Download Details:

Author: kmatzka
Source Code: https://github.com/kmatzka/HUD 

#swift #swiftui #display 

HUD: A Simple SwiftUI Head Up Display
1.50 GEEK