Simple Alert View written in Swift, which can be used as a UIAlertController. (AlertController/AlertView/ActionSheet)

Overview

DOAlertController

Simple Alert View written in Swift, which can be used as a UIAlertController replacement.
It supports from iOS7! It is simple and easily customizable!

BackgroundImage BackgroundImage

Easy to use

DOAlertController can be used as a UIAlertController.

// Set title, message and alert style
let alertController = DOAlertController(title: "title", message: "message", preferredStyle: .Alert)

// Create the action.
let cancelAction = DOAlertAction(title: "Cancel", style: .Cancel, handler: nil)

// You can add plural action.
let okAction = DOAlertAction(title: "OK" style: .Default) { action in
    NSLog("OK action occured.")
}

// Add the action.
alertController.addAction(cancelAction)
alertController.addAction(okAction)

// Show alert
presentViewController(alertController, animated: true, completion: nil)

Customize

  • add TextField (Alert style only)
  • change Fonts
  • change color (Overlay, View, Text, Buttons)

BackgroundImage BackgroundImage

Add TextField

alertController.addTextFieldWithConfigurationHandler { textField in
    // text field(UITextField) setting
    // ex) textField.placeholder = "Password"
    //     textField.secureTextEntry = true
}

Change Design

Overlay color
alertController.overlayColor = UIColor(red:235/255, green:245/255, blue:255/255, alpha:0.7)
Background color
alertController.alertViewBgColor = UIColor(red:44/255, green:62/255, blue:80/255, alpha:1)
Title (font, text color)
alertController.titleFont = UIFont(name: "GillSans-Bold", size: 18.0)
alertController.titleTextColor = UIColor(red:241/255, green:196/255, blue:15/255, alpha:1)
Message (font, text color)
alertController.messageFont = UIFont(name: "GillSans-Italic", size: 15.0)
alertController.messageTextColor = UIColor.whiteColor()
Button (font, text color, background color(default/highlighted))
alertController.buttonFont[.Default] = UIFont(name: "GillSans-Bold", size: 16.0)
alertController.buttonTextColor[.Default] = UIColor(red:44/255, green:62/255, blue:80/255, alpha:1)
alertController.buttonBgColor[.Default] = UIColor(red: 46/255, green:204/255, blue:113/255, alpha:1)
alertController.buttonBgColorHighlighted[.Default] = UIColor(red:64/255, green:212/255, blue:126/255, alpha:1)
// Default style : [.Default]
// Cancel style : [.Default] → [.Cancel]
// Destructive style : [.Default] → [.Destructive]

Installation

DOAlertController is available through CocoaPods.

To install add the following line to your Podfile:

pod 'DOAlertController'

License

This software is released under the MIT License, see LICENSE.txt.

You might also like...
FCAlertView is a Flat Customizable AlertView for iOS (Written in Objective C)
FCAlertView is a Flat Customizable AlertView for iOS (Written in Objective C)

FCAlertView FCAlertView is a Flat Customizable AlertView, written in Objective C Quick Links 1. Swift 2. Installation 3. Example App 4. Adding FCAlert

A simple and attractive AlertView to ask permission to your users for Push Notification.
A simple and attractive AlertView to ask permission to your users for Push Notification.

A simple and attractive AlertView **to ask permission to your users for Push Notification.** PRESENTATION Ask permission to user for push notification

Swift Package mimicking UIKit's ActionSheet with added features
Swift Package mimicking UIKit's ActionSheet with added features

ActionSheetController A Swift package that mimics the UIAlertController Actionsheet with added features. ActionSheetController gives you the ability t

A customizable, full-feature, lightweight iOS framework to be used instead of UIAlertController.
A customizable, full-feature, lightweight iOS framework to be used instead of UIAlertController.

A customizable, full-feature, lightweight iOS framework to be used instead of UIAlertController.

📑 Actionsheet with navigation features such as the Flipboard App
📑 Actionsheet with navigation features such as the Flipboard App

📑 SHEET helps you easily create a wide variety of action sheets with navigation features used in the Flipboard App Installation CocoaPods pod 'Sheet'

FCAlertView is a Flat Customizable AlertView for iOS (Swift)
FCAlertView is a Flat Customizable AlertView for iOS (Swift)

FCAlertView FCAlertView is a Flat Customizable AlertView, written in Swift [![CI Status](http://img.shields.io/travis/Nima Tahami/FCAlertView.svg?styl

Cool AlertView
Cool AlertView

AMSmoothAlert • Now include multiple buttons feature you asked :) • Now available on Cocoapods : AMSmoothAlert I saw this pretty cool alert view conce

JAlert - This is "Alert View" project for UIKit + SwiftUI. you can use easily

JAlert Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements Installation JAlert is a

Beautiful animated Alert View. Written in Swift
Beautiful animated Alert View. Written in Swift

SCLAlertView Animated Alert View written in Swift, which can be used as a UIAlertView or UIAlertController replacement. Since UIAlertView is deprecate

Comments
  • Cannot present alert in action of another alert

    Cannot present alert in action of another alert

    I am trying to present a second alert after presenting one already, but it seems that the action doesn't get called. Is there something wrong with the class, or am I missing something?

    opened by eeschimosu 1
  • Alert position is wrong when used on a popover control on ipad

    Alert position is wrong when used on a popover control on ipad

    When using the control source as a popover control (or page sheet view) (on ipad), the location of the presented alert is not centered

    this is a picture showing the problem: https://ibb.co/fR2RKS

    opened by hadiyazdi 0
  • Swift 4

    Swift 4

    its an awesome library but can you update it to swift 4? its very bad that we manually need to fix the errors and then when we do pod install or update to get another library we lose every change.

    thanks!

    opened by xZeok 0
  • Cannot show another view controller by pressing button

    Cannot show another view controller by pressing button

    It's a nice and easy library for alert controller. However, I have a question.

    In my program, as I press the button, I want to show another view controller. So I use "performSegue" to do that. It works on UIAlertController. When I change to DOAlertController, the view didn't show up, but the code which I write in that view controller still appear in log. (It still prints what I want to show).

    The error message is: Warning: Attempt to present <XXX.AnotherViewController: 0x101933400> on <DOAlertController: 0x101928a00> whose view is not in the window hierarchy!

    I'm wondering if somebody can give me some directions, thanks a lot. :-)

    opened by shiaubo 0
Releases(1.0.0)
Owner
Daiki Okumura
Daiki Okumura
Highly customizable alertview and alert/notification/success/error/alarm popup written in Swift

CDAlertView is highly customizable alert popup written in Swift. Usage is similar to UIAlertController. Screenshots Animations Usage Basic usage witho

Candost Dagdeviren 1.1k Dec 30, 2022
A simple custom popup dialog view for iOS written in Swift. Replaces UIAlertController alert style.

A simple custom popup dialog view for iOS written in Swift. Replaces UIAlertController alert style.

donggyu 5 Jan 26, 2022
A simple, customizable popup dialog for iOS written in Swift. Replaces UIAlertController alert style.

Introduction Popup Dialog is a simple, customizable popup dialog written in Swift. Features Easy to use API with hardly any boilerplate code Convenien

Orderella Ltd. 3.8k Dec 20, 2022
PMAlertController is a great and customizable alert that can substitute UIAlertController

PMAlertController is a small library that allows you to substitute Apple's uncustomizable UIAlertController, with a beautiful and totally customizable

Paolo Musolino 2.5k Jan 3, 2023
PMAlertController is a great and customizable alert that can substitute UIAlertController

PMAlertController is a small library that allows you to substitute Apple's uncustomizable UIAlertController, with a beautiful and totally customizable

Paolo Musolino 2.5k Jan 3, 2023
A Simple And Minimalist iOS AlertController

HYAlertController HYAlertController is a minimalist alert control, that contains a variety of usage scenarios. It has the same syntax as Apple's UIAle

null 63 Jul 26, 2022
AlertView A pop-up framework, Can be simple and convenient to join your project.

RAlertView AlertView A pop-up framework, Can be simple and convenient to join your project. Warning content Installation Depend on the project Masonry

杜耀辉 71 Aug 12, 2022
Swift AlertController with UIVisualeffectview

PCLBlurEffectAlert Swift AlertController, use UIVisualeffectview Requirements iOS 8.0+ Swift 3.0+ ARC Feature Change color Change effect Change font U

Hiroyuki Yoshida 147 Jun 29, 2022
An easier constructor for UIAlertController. Present an alert from anywhere.

ALRT An easier constructor for UIAlertController. Present an alert from anywhere like this. ALRT.create(.alert, title: "Alert?").addOK().addCancel().s

Masahiro Watanabe 97 Nov 11, 2022
An easier constructor for UIAlertController. Present an alert from anywhere.

ALRT An easier constructor for UIAlertController. Present an alert from anywhere like this. ALRT.create(.alert, title: "Alert?").addOK().addCancel().s

Masahiro Watanabe 97 Nov 11, 2022