Something went wrong. Try again.
Something went wrong. Try again.
1.4 kB · 57 lines
Swift
at main
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758//// Untitled.swift// shortcut//// Created by Bailey Townsend on 6/27/25.//
import SwiftUI
// MARK: - Loading Overlay Componentstruct LoadingOverlay: View { let message: String?
init(message: String? = nil) { self.message = message }
var body: some View { ZStack { // Semi-transparent background Color.black.opacity(0.4) .ignoresSafeArea()
// Loading content VStack(spacing: 16) { ProgressView() .scaleEffect(1.2) .progressViewStyle(CircularProgressViewStyle(tint: .white))
if let message = message { Text(message) .foregroundColor(.white) .font(.system(size: 16, weight: .medium)) .multilineTextAlignment(.center) } } .padding(24) .background( RoundedRectangle(cornerRadius: 12) .fill(Color.black.opacity(0.8)) ) } }}
// MARK: - View Extension for Easy Usageextension View { func loadingOverlay(isShowing: Bool, message: String? = nil) -> some View { ZStack { self
if isShowing { LoadingOverlay(message: message) } } }}