CDAlertView alternatives and similar libraries
Based on the "Alerts" category.
Alternatively, view CDAlertView alternatives based on common mentions on social networks and blogs.
-
SwiftMessages
A very flexible message bar for iOS written in Swift. -
SCLAlertView-Swift
Beautiful animated Alert View. Written in Swift -
TSMessages
๐ Easy to use and customizable messages/notifications for iOS ร la Tweetbot -
NotificationBanner
The easiest way to display highly customizable in app notification banners in iOS -
JDStatusBarNotification
Highly customizable & feature rich notifications displayed below the status bar. iOS 13+. Swift ready! -
CRToast
A modern iOS toast view that can fit your notification needs -
Whisper
:mega: Whisper is a component that will make the task of display messages and in-app notifications simple. It has three different views inside -
Toast-Swift
A Swift extension that adds toast notifications to the UIView object class. -
PMAlertController
PMAlertController is a great and customizable alert that can substitute UIAlertController -
Jelly
๐ - Jelly is a library for animated, non-interactive & interactive viewcontroller transitions and presentations with the focus on a simple and yet flexible API. -
RKDropdownAlert
iOS / Objective C: an extremely simple UIAlertView alternative -
RMDateSelectionViewController
This is an iOS control for selecting a date using UIDatePicker in an UIAlertController like manner -
BRYXBanner
A lightweight dropdown notification for iOS 7+, in Swift. -
CFAlertViewController
It is a highly configurable iOS library which allows easy styling with built in styles as well as extra header and footer views so that you can make extremely unique alerts and action sheets. -
FCAlertView
FCAlertView is a Flat Customizable AlertView for iOS (Written in Objective C) -
SwiftNotice
GUI library for displaying various popups (HUD), written in pure Swift. -
NZAlertView
Simple and intuitive alert view. Similar to push notification effect. -
Swift-Prompts
A Swift library to design custom prompts with a great scope of options to choose from. -
SwiftyDrop
Lightweight dropdown message bar in Swift. It's simple and beautiful. -
NYAlertViewController
Highly configurable iOS Alert Views with custom content views -
TTGSnackbar
TTGSnackbar shows simple message and action button on the bottom or top of the screen with multi kinds of animation, which is written in Swift3 and inspired by Snackbar in Android. It also support showing custom view, icon image or multi action button. -
SwiftOverlays
SwiftOverlays is a Swift GUI library for displaying various popups and notifications -
RMActionController
This is an iOS control for presenting any UIView in an UIAlertController like manner -
DOAlertController
Simple Alert View written in Swift, which can be used as a UIAlertController. (AlertController/AlertView/ActionSheet) -
SimpleAlert
Customizable simple Alert and simple ActionSheet for Swift -
RMPickerViewController
This is an iOS control for selecting something using UIPickerView in an UIAlertController like manner -
HDNotificationView
Emulates the native Remote Notification View. -
NoticeBar
๐A simple NoticeBar written by Swift 3, similar with QQ notice view. -
LNRSimpleNotifications
Simple Swift in-app notifications -
CustomizableActionSheet
Action sheet allows including your custom views and buttons. -
LKAlertController
An easy to use UIAlertController builder for swift -
BPStatusBarAlert
BPStatusBarAlert is a library that allows you to easily make text-based alert that appear on the status bar and below navigation bar. -
MaterialActionSheetController
A Google like action sheet for iOS written in Swift. -
RAlertView
AlertView, Ios popup window, A pop-up framework, Can be simple and convenient to join your project. IOS ๆ็คบๆก๏ผIOSๅผนๆก๏ผIOSๅผน็ช -
Notie
In-app notification in Swift, with customizable buttons and input text field. -
SnowGlobeFramework
Snow globe framework is delightful / slightly cheese easter egg for christmas season. Turns your awesome app into a snow globe, when user shake the device. -
AlertViewLoveNotification
A simple and attractive AlertView to ask permission to your users for Push Notification.
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of CDAlertView or a related project?
README
CDAlertView is highly customizable alert popup written in Swift. Usage is similar to UIAlertController
.
Screenshots
Animations
Usage
Basic usage without any buttons:
CDAlertView(title: "Awesome Title", message: "Well explained message!", type: .notification).show()
NOTE: You can use it without buttons. Touch outside of the popup or move it will disappear it if there is no action button. If there is an action button, only pressing button will disappear it.
To add new buttons:
let alert = CDAlertView(title: "Awesome Title", message: "Are you in?!", type: .notification)
let doneAction = CDAlertViewAction(title: "Sure! ๐ช")
alert.add(action: doneAction)
let nevermindAction = CDAlertViewAction(title: "Nevermind ๐")
alert.add(action: nevermindAction)
alert.show()
To enable text field in popup:
alert.isTextFieldHidden = false
Custom view is also supported. If you want to use custom view, you are responsible for the height of custom view. Custom view is used in UIStackView
.
let myCustomView = UIVIew(frame: myFrame)
// Don't forget to handle height of `myCustomView`
alert.customView = myCustomView
CDAlertView types:
public enum CDAlertViewType {
case error, warning, success, notification, alarm, noImage, custom(image:UIImage)
}
Initialization
Advanced Alert Initialization
To use it with your custom icon, initialize without type (or with .empty) and set your icon and background color:
let alert = CDAlertView(title: "Awesome Title", message: "Well explained message!", type: .custom(image: UIImage(named:"YourAwesomeImage")))
alert.circleFillColor = UIColor.yourAmazingColor
Hide Alert with your animation
let alert = CDAlertView(title: "Awesome Title", message: "Well explained message!", type: .success)
alert.hideAnimations = { (center, transform, alpha) in
transform = CGAffineTransform(scaleX: 3, y: 3)
alpha = 0
}
alert.hideAnimationDuration = 0.88
alert.show()
Hide Alert with timer
let alert = CDAlertView(title: "Awesome Title", message: "Well explained message!", type: .success)
alert.autoHideTime = 4.5 // This will hide alert box after 4.5 seconds
List of Available CDAlertView Options
titleTextColor: UIColor
-> Sets title's text color
messageTextColor: UIColor
-> Sets message's text color
titleFont: UIFont
-> Sets title's font
messageFont: UIFont
-> Sets message's font
isHeaderIconFilled: Bool
-> Chooses filled icons instead of outline ones. Default is false
.
alertBackgroundColor: UIColor
-> Sets popup's background color.
popupWidth: CGFloat
-> Width of the popup view
hasRoundedCorners: Bool
-> Apply rounded corners to alert view. Default is true
.
hasShadow: Bool
-> Apply shadows around the popup. Defualt is true
.
circleFillColor: UIColor
-> Sets background color of header icon. (Color of circle area)
isActionButtonsVertical: Bool
-> Alignes action buttons vertical. Default is false
. Maximum number of horizontal buttons is 3.
hideAnimationDuration: TimeInterval
-> Sets the animation duration of hide animation
hideAnimations: CDAlertAnimationBlock
-> Sets the hiding animations depending on the center
, transform
and alpha
values. You can create your animations by changing these values for alert popup.
If you enabled text field with setting isTextFieldHidden
property to false
, following properties will be available also:
textFieldFont: UIFont
-> Font of textField's text
textFieldIsSecureTextEntry: Bool
-> Sets the isSecureTextEntry
property of UITextField
textFieldReturnKeyType: UIReturnKeyType
-> Sets the returnKeyType
property of UITextField
textFieldTextAlignment: NSTextAlignment
-> Sets the textAlignment
property of UITextField
. Default is .left
.
textFieldPlaceholderText: String?
-> Sets the placeholder text for UITextField
.
textFieldAutocapitalizationType: UITextAutocapitalizationType
-> Sets the autocapitalizationType
property of UITextField
. Default is .none
.
textFieldBackgroundColor: UIColor
-> Sets UITextField
's background color.
textFieldTintColor: UIColor
-> Sets UITextField
's tint color.
textFieldText: String?
-> Sets & gets UITextField
's text.
textFieldHeight: CGFloat
-> Sets the height of UITextField
.
textFieldDelegate: UITextViewDelegate?
-> Sets the delegate of UITextField
. Default delegate is CDAlertView
. If you overwrite this, you're responsible for resigning the UITextField
.
autoHideTime: TimeInterval?
-> Sets the time interval for dismiss time. Default is nil
.
Advanced action initialization:
font
, textColor
, backgroundColor
, handler
are all optional and has default parameter values. You can initilize with them or set them after initialization.
let action = CDAlertViewAction(title: "Action Title", font: UIFont.yourCustomFont, textColor: UIColor.yourTextColor, backgroundColor: UIColor.yourBackgroundColor, handler: { action in })
alertView.addAction(action)
NOTE: Aligning buttons vertical and horizontal is possible. But using more than 3 buttons in horizontal placement is not possible.
List of CDAlertViewAction Options
buttonTitle: String
-> Set's the action button title
buttonTextColor: UIColor
-> Sets the action button title color. Default value is RGB(27,169,225).
buttonFont: UIFont
-> Sets the action button title font. Default value is UIFont.systemFont(ofSize: 17)
.
buttonBackgroundColor: UIColor
-> Sets the background color of action button. If not set, it uses alertBackgroundColor
of CDAlertView.
List of available methods
textFieldBecomeFirstResponder()
-> Calls the becomeFirstResponder()
method of textField
if alert.isTextFieldHidden
set to true
. Otherwise, does nothing.
textFieldResignFirstResponder()
-> Calls the resignFirstResponder()
method of textField
if alert.isTextFieldHidden
set to true
. Otherwise, does nothing.
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
Installation
This library supports Swift 5. Use 0.9.1
for Swift 4.2. Use 0.6.1
for Swift 3.1.
Using CocoaPods
CDAlertView is available through CocoaPods. To install it, simply add the following line to your Podfile
:
pod "CDAlertView"
Using Carthage
CDAlertView is available through Carthage. To install it, simply add the following line to your Cartfile
:
github "candostdagdeviren/CDAlertView"
Requirements
- Xcode 9
- Swift 4
- iOS 9.0+
Icons
Thanks to Icons8 for beautiful icons.
License
CDAlertView is available under the MIT license. See the LICENSE file for more info.
*Note that all licence references and agreements mentioned in the CDAlertView README section above
are relevant to that project's source code only.