Skip to content

Instantly share code, notes, and snippets.

View shanmugam105's full-sized avatar
🎯
Focusing

Shanmugarajeshwaran R shanmugam105

🎯
Focusing
  • Sparkout Tech Solution
  • Coimbatore
View GitHub Profile
@shanmugam105
shanmugam105 / AlertView+Extension.swift
Created April 3, 2024 14:00
Wrapper for present alert in SwiftUI
extension View {
func present<Content: View>(_ isPresented: Binding<Bool>, content: () -> Content) -> some View {
Group {
if isPresented.wrappedValue {
ZStack {
self
content()
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
} else {