SwiftUIAlert

1.0.4

Show System Alerts Easily in SwiftUI
Mcrich23/SwiftUIAlert

What's New

1.0.4

2023-06-07T08:15:31Z
  • Added dismissAnyAlertIfPresent (See README.md)

SwiftUIAlert

Show system alerts easily in SwiftUI

show

SwiftUIAlert.show(title: "Hello Word!", //Alert Title
                    message: "Lorem Ipsum", //Alert Message
                    preferredStyle: .alert, //Style (alert or action sheet)
                    actions: [UIAlertAction(title: "Done", //Action Title
                                            style: .default, //Action Style (default, destructive, dismiss)
                                            handler: {_ in}) //Handler for choosing that action
                    ]
)

textfieldShow

SwiftUIAlert.textfieldShow(title: "Test", //Alert Title
                            message: "Hello World!", //Alert Message
                            preferredStyle: .alert, //Style (alert or action sheet)
                            textfield: AlertTextfield(text: $text, //Textfield Text
                                                        placeholder: "", //Textfield Placeholder
                                                        clearButtonMode: .whileEditing, //When to show clear butt(always, whileEditing, unlessEditing, or never)
                                                        enablesReturnKeyAutomatically: true, //Show return key keyboard
                                                        disableAutocorrection: false, //Disable Autocorrection?
                                                        autocapitalization: .sentences, //Autocapitalization (nonsentances, allCharacter, or words)
                                                        keyboardType: .default, //The type of keyboard
                                                        returnKeyType: .default, //Type of return key on keyboard
                                                        isSecureTextEntry: .no, //Is Secure Textfield? (.yes(UITextInputPassordRules) or .no)
                                                        dismissKeyboardOnReturn: true), //Dismiss keyboard on return?
                            actions: [UIAlertAction(title: "Done", style: .default)]
)

dismissAnyAlertIfPresent

Dismisses any alerts present

SwiftUIAlert.dismissAnyAlertControllerIfPresent()

Description

  • Swift Tools 5.7.0
View More Packages from this Author

Dependencies

Last updated: Thu Mar 14 2024 21:26:36 GMT-0900 (Hawaii-Aleutian Daylight Time)