Created
November 23, 2021 10:21
-
-
Save waseem-pk/f0934bf84e46f2c15c9581b5057d1459 to your computer and use it in GitHub Desktop.
Alert Extension for SwiftUi, iOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public struct TextAlert { | |
public var title: String | |
public var placeholder: String = "" | |
public var accept: String = "OK" | |
public var cancel: String = "Cancel" | |
public var action: (String?) -> () | |
} | |
extension View { | |
public func alert(isPresented: Binding<Bool>, _ alert: TextAlert) -> some View { | |
AlertWrapper(isPresented: isPresented, alert: alert, content: self) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment