SCLAlertView-Swift alternatives and similar libraries
Based on the "Alerts" category.
Alternatively, view SCLAlertView alternatives based on common mentions on social networks and blogs.
-
SwiftMessages
A very flexible message bar for iOS 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 -
SweetAlert
Live animated Alert View for iOS written in Swift -
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 -
CDAlertView
Highly customizable alertview and alert/notification/success/error/alarm popup written in Swift -
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. -
SwiftNotice
GUI library for displaying various popups (HUD), written in pure Swift. -
FCAlertView
FCAlertView is a Flat Customizable AlertView for iOS (Written in Objective C) -
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. -
GSMessages
A simple style messages/notifications, in Swift. -
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 -
CZPicker
a picker view shown as a popup for iOS in Objective-C -
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. -
KRAlertController
A colored alert view for your iOS. -
AlertViewLoveNotification
A simple and attractive AlertView to ask permission to your users for Push Notification.
Appwrite - The open-source backend cloud platform
* 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 SCLAlertView-Swift or a related project?
README
SCLAlertView
Animated Alert View written in Swift, which can be used as a UIAlertView
or UIAlertController
replacement. Since UIAlertView
is deprecated and UIAlertController
only works on iOS 8.x or above, if you have a Swift project where you want to support iOS 7.x too, SCLAlertView is an ideal substitution.
_
Easy to use
Get Started
// Get started
SCLAlertView().showInfo("Important info", subTitle: "You are great")
Updating the alert view
let alertViewResponder: SCLAlertViewResponder = SCLAlertView().showSuccess("Hello World", subTitle: "This is a more descriptive text.")
// Upon displaying, change/close view
alertViewResponder.setTitle("New Title") // Rename title
alertViewResponder.setSubTitle("New description") // Rename subtitle
alertViewResponder.close() // Close view
Alternative alert types
SCLAlertView().showError("Hello Error", subTitle: "This is a more descriptive error text.") // Error
SCLAlertView().showNotice("Hello Notice", subTitle: "This is a more descriptive notice text.") // Notice
SCLAlertView().showWarning("Hello Warning", subTitle: "This is a more descriptive warning text.") // Warning
SCLAlertView().showInfo("Hello Info", subTitle: "This is a more descriptive info text.") // Info
SCLAlertView().showEdit("Hello Edit", subTitle: "This is a more descriptive info text.") // Edit
Raw call to showTitle()
SCLAlertView().showTitle(
"Congratulations", // Title of view
subTitle: "Operation successfully completed.", // String of view
duration: 2.0, // Duration to show before closing automatically, default: 0.0
completeText: "Done", // Optional button value, default: ""
style: .success, // Styles - see below.
colorStyle: 0xA429FF,
colorTextButton: 0xFFFFFF
)
Controls
Custom Appearance
// SCLAlertView.SCLAppearanc has more than 15 different properties to customize. See below.
let appearance = SCLAlertView.SCLAppearance(
kTitleFont: UIFont(name: "HelveticaNeue", size: 20)!,
kTextFont: UIFont(name: "HelveticaNeue", size: 14)!,
kButtonFont: UIFont(name: "HelveticaNeue-Bold", size: 14)!,
showCloseButton: false
)
let alert = SCLAlertView(appearance: appearance)
Add buttons
let alertView = SCLAlertView()
alertView.addButton("First Button", target:self, selector:Selector("firstButton"))
alertView.addButton("Second Button") {
print("Second button tapped")
}
alertView.showSuccess("Button View", subTitle: "This alert view has buttons")
Hide default close button
let appearance = SCLAlertView.SCLAppearance(
showCloseButton: false
)
let alertView = SCLAlertView(appearance: appearance)
alertView.showSuccess("No button", subTitle: "You will have hard times trying to close me")
Hide default close button & a duration to close the alert
let appearance = SCLAlertView.SCLAppearance(
showCloseButton: false
)
let alertView = SCLAlertView(appearance: appearance)
alertView.showWarning("No button", subTitle: "Just wait for 3 seconds and I will disappear", duration: 3)
Hide alert icon
let appearance = SCLAlertView.SCLAppearance(
showCircularIcon: false
)
let alertView = SCLAlertView(appearance: appearance)
alertView.showSuccess("No icon", subTitle: "This is a clean alert without Icon!")
Use a custom icon
let appearance = SCLAlertView.SCLAppearance(
showCircularIcon: true
)
let alertView = SCLAlertView(appearance: appearance)
let alertViewIcon = UIImage(named: "IconImage") //Replace the IconImage text with the image name
alertView.showInfo("Custom icon", subTitle: "This is a nice alert with a custom icon you choose", circleIconImage: alertViewIcon)
Add Text fields
// Add a text field
let alert = SCLAlertView()
let txt = alert.addTextField("Enter your name")
alert.addButton("Show Name") {
print("Text value: \(txt.text)")
}
alert.showEdit("Edit View", subTitle: "This alert view shows a text box")
Use a custom subview instead of a subtitle
// Example of using the view to add two text fields to the alert
// Create the subview
let appearance = SCLAlertView.SCLAppearance(
kTitleFont: UIFont(name: "HelveticaNeue", size: 20)!,
kTextFont: UIFont(name: "HelveticaNeue", size: 14)!,
kButtonFont: UIFont(name: "HelveticaNeue-Bold", size: 14)!,
showCloseButton: false
)
// Initialize SCLAlertView using custom Appearance
let alert = SCLAlertView(appearance: appearance)
// Creat the subview
let subview = UIView(frame: CGRectMake(0,0,216,70))
let x = (subview.frame.width - 180) / 2
// Add textfield 1
let textfield1 = UITextField(frame: CGRectMake(x,10,180,25))
textfield1.layer.borderColor = UIColor.greenColor().CGColor
textfield1.layer.borderWidth = 1.5
textfield1.layer.cornerRadius = 5
textfield1.placeholder = "Username"
textfield1.textAlignment = NSTextAlignment.Center
subview.addSubview(textfield1)
// Add textfield 2
let textfield2 = UITextField(frame: CGRectMake(x,textfield1.frame.maxY + 10,180,25))
textfield2.secureTextEntry = true
textfield2.layer.borderColor = UIColor.blueColor().CGColor
textfield2.layer.borderWidth = 1.5
textfield2.layer.cornerRadius = 5
textfield1.layer.borderColor = UIColor.blueColor().CGColor
textfield2.placeholder = "Password"
textfield2.textAlignment = NSTextAlignment.Center
subview.addSubview(textfield2)
// Add the subview to the alert's UI property
alert.customSubview = subview
alert.addButton("Login") {
print("Logged in")
}
// Add Button with Duration Status and custom Colors
alert.addButton("Duration Button", backgroundColor: UIColor.brownColor(), textColor: UIColor.yellowColor(), showDurationStatus: true) {
print("Duration Button tapped")
}
alert.showInfo("Login", subTitle: "", duration: 10)
List of properties to customize
// Button
kButtonFont: UIFont
buttonCornerRadius : CGFloat
showCloseButton: Bool
kButtonHeight: CGFloat
// Circle Image
showCircularIcon: Bool
kCircleTopPosition: CGFloat
kCircleBackgroundTopPosition: CGFloat
kCircleHeight: CGFloat
kCircleIconHeight: CGFloat
// Text
kTitleFont: UIFont
kTitleTop:CGFloat
kTitleHeight:CGFloat
kTextFont: UIFont
kTextHeight: CGFloat
kTextFieldHeight: CGFloat
kTextViewdHeight: CGFloat
// View
kDefaultShadowOpacity: CGFloat
kWindowWidth: CGFloat
kWindowHeight: CGFloat
shouldAutoDismiss: Bool // Set this false to 'Disable' Auto hideView when SCLButton is tapped
fieldCornerRadius : CGFloat
contentViewCornerRadius : CGFloat
disableTapGesture: Bool // set this to true if adding tableview to subView
Alert View Styles
enum SCLAlertViewStyle: Int {
case success, error, notice, warning, info, edit, wait, question
}
Alert show animation Styles
// Animation Styles
public enum SCLAnimationStyle {
case noAnimation, topToBottom, bottomToTop, leftToRight, rightToLeft
}
Installation
SCLAlertView is available through
CocoaPods
To install add the following line to your Podfile:
pod 'SCLAlertView'
Carthage
To install add the following line to your Cartfile:
github "vikmeup/SCLAlertView-Swift" "master"
Collaboration
I tried to build an easy to use API, while beeing flexible enough for multiple variations, but I'm sure there are ways of improving and adding more features, so feel free to collaborate with ideas, issues and/or pull requests.
Incoming improvements
- More animations
- Performance tests
Has been developed initially for the Scroll Feed app
- Design @SherzodMx Sherzod Max
- Development @vikmeup Viktor Radchenko
- Improvements by @bih Bilawal Hameed, @rizjoj Riz Joj