Skip to content

jimhqin/AlertSheet

Repository files navigation

AlertSheet

AlertSheet is a user interface alert inspired by UIActionSheet.

Features

  • Beautiful design
  • Customizable
  • Simple and lightweight
  • Future proofed for all screen sizes

Requirements

  • iOS 7.0+

Installation

Drag and drop AlertSheet.swift, AlertSheetButton.swift and AlertSheetLabel.swift into your project.

Usage

Displaying an AlertSheet

let alertSheet = AlertSheet(
            title: "Network Error",
            message: "You appear to be offline. Check your connection and try again.",
            buttonTitle: "OK",
            image: nil
)
alertSheet.delegate = self
alertSheet.showInView(view)

Handling AlertSheet State

// MARK: - AlertSheetDelegate Protocol

func alertSheet(alertSheet: AlertSheet, clickedButtonAtIndex buttonIndex: Int) {
    switch buttonIndex {
    case 0: alertSheet.dismiss()
    default: alertSheet.dismiss()
    }
}

License

AlertSheet is released under the MIT license. See LICENSE for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages