AirAlert

0.0.5

Simple, clean alerts for iOS
kkadhith/AirAlert

What's New

0.0.5

2025-04-17T06:37:31Z

Release Notes

AirAlert 0.0.5 improves AirAlert by adding the following:

  • Fixed text field responsiveness to avoid a small hang between user pressing enter after using the keyboard
  • Added haptic feedback

AirAlert

AirAlert is a simple, clean view modifier that displays an alert with a few properties. It has no dependencies and is written entirely in SwiftUI.

Header Image

Use Case

AirAlert can be used just like Apple's native alert modifier. However, AirAlert can give users a native feel to your app specifically. It's generally customizable and is best used when confirming/cancelling something in your app that isn't necessarily related to system/app settings.

Usage

To present an alert in SwiftUI, use .airAlert(isPresented:title:alertMessage:mainButtonLabel:secondButtonLabel:mainButtonAction:secondButtonAction) modifier.

For instance:

import SwiftUI
import AirAlert

struct ContentView: View {
    @State private var isShown = false
    
    var body: some View {
        Button(action: {isShown.toggle()}) {
            Text("AirAlert!")
        }
        .airAlert(isPresented: $isShown,
                  title: "Alert!", alertMessage: "A clean, simple alert!",
                  mainButtonLabel: "OK",
                  secondButtonLabel: "Cancel",
                  mainButtonAction: {},
                  secondButtonAction: {})
    }
}

Description

  • Swift Tools 6.0.0
View More Packages from this Author

Dependencies

  • None
Last updated: Thu May 15 2025 20:23:13 GMT-0900 (Hawaii-Aleutian Daylight Time)