A simple, lightweight, flat alternative to UIAlertController written in Swift for iOS
- Header View
- Title
- Description message
- Customizations: fonts, colors, dimensions & more
- 1, 2 buttons (horizontally) or 3+ buttons (vertically)
- Closure when a button is pressed
- Similar implementation to UIAlertController
- Cocoapods
- Animation with UIKit Dynamics
- Objective-C compatibility
- Swift 2.3 & Swift 3 support
- iOS 9.0+
- Xcode 8+
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
$ gem install cocoapodsTo integrate Flat Alert into your Xcode project using CocoaPods, specify it in your Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
pod 'Flat-Alert'Then, run the following command:
$ pod install- Download and drop
/Libraryfolder in your project. - Congratulations!
The usage is very similar to UIAlertController.
Flat Alert has two styles: Alert & Walkthrough.
//Create the alert
let alert = FlatAlert(title: "Flat Alert", message: "Wow, dosen't this look amazing? I am completely astonished by this work that I must donate via PayPal immediately!", style: .alert)
//create the action
let action = FlatAlertAction(title: "Ok", style: .normal) {
print("Pressed ok action")
}
//add the action
alert.add(action: action)
//present the alert
present(alert, animated: true, completion: nil)- If you need help or you'd like to ask a general question, open an issue.
- If you found a bug, open an issue.
- If you have a feature request, open an issue.
- If you want to contribute, submit a pull request.
Flat Alert is available under the MIT license. See the LICENSE file for more info.

