Skip to content

ingeniousgenius/Flat-Alert

Repository files navigation

Flat Alert

A simple, lightweight, flat alternative to UIAlertController written in Swift for iOS

Sreenshots


alt alt

Features


  • 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

Requirements


  • iOS 9.0+
  • Xcode 8+

CocoaPods


CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To 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

Manually


  1. Download and drop /Library folder in your project.
  2. Congratulations!

Usage


The usage is very similar to UIAlertController. Flat Alert has two styles: Alert & Walkthrough.

Show a simple alert with two button

//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)

Contributing

  • 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.

MIT License


Flat Alert is available under the MIT license. See the LICENSE file for more info.

About

A simple, lightweight, flat alternative to UIAlertController written in Swift for iOS

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors