SimpleAlert alternatives and similar libraries
Based on the "Alerts" category.
Alternatively, view SimpleAlert 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 -
CRToast
A modern iOS toast view that can fit your notification needs -
JDStatusBarNotification
Highly customizable & feature rich notifications displayed below the status bar. iOS 13+. Swift ready! -
Toast-Swift
A Swift extension that adds toast notifications to the UIView object class. -
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 -
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. -
CDAlertView
Highly customizable alertview and alert/notification/success/error/alarm popup written 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. -
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. -
NYAlertViewController
Highly configurable iOS Alert Views with custom content views -
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) -
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 SimpleAlert or a related project?
README
SimpleAlert
It is simple and easily customizable alert.
Can be used as UIAlertController
.
Appetize's Demo
Requirements
- Swift 5.0
- iOS 9.0 or later
How to Install SimpleAlert
Cocoapods
Add the following to your Podfile
:
pod "SimpleAlert"
Carthage
Add the following to your Cartfile
:
github "KyoheiG3/SimpleAlert"
Usage
Example
View simple Alert
let alert = AlertController(title: "title", message: "message", style: .alert)
alert.addTextField()
alert.addAction(AlertAction(title: "Cancel", style: .cancel))
alert.addAction(AlertAction(title: "OK", style: .ok))
present(alert, animated: true, completion: nil)
Customize default contents
let alert = AlertController(title: "title", message: "message", style: .alert)
alert.addTextField { textField in
textField.frame.size.height = 33
textField.backgroundColor = nil
textField.layer.borderColor = nil
textField.layer.borderWidth = 0
}
alert.configureContentView { view in
view.titleLabel.textColor = UIColor.lightGrayColor()
view.titleLabel.font = UIFont.boldSystemFontOfSize(30)
view.messageLabel.textColor = UIColor.lightGrayColor()
view.messageLabel.font = UIFont.boldSystemFontOfSize(16)
view.textBackgroundView.layer.cornerRadius = 3.0
view.textBackgroundView.clipsToBounds = true
}
alert.addAction(AlertAction(title: "Cancel", style: .cancel))
alert.addAction(AlertAction(title: "OK", style: .ok))
present(alert, animated: true, completion: nil)
Rounded button Alert View
let alert = AlertController(view: UIView(), style: .alert)
alert.contentWidth = 144
alert.contentCornerRadius = 72
alert.contentColor = .white
let action = AlertAction(title: "?", style: .cancel) { action in
}
alert.addAction(action)
action.button.frame.size.height = 144
action.button.titleLabel?.font = UIFont.boldSystemFont(ofSize: 96)
action.button.setTitleColor(UIColor.red, for: .normal)
present(alert, animated: true, completion: nil)
More customizable if you create a subclass
class CustomAlertController: AlertController {
override func addTextField(configurationHandler: ((UITextField) -> Void)? = nil) {
super.addTextField { textField in
textField.frame.size.height = 33
textField.backgroundColor = nil
textField.layer.borderColor = nil
textField.layer.borderWidth = 0
configurationHandler?(textField)
}
}
override func configureActionButton(_ button: UIButton, at style :AlertAction.Style) {
super.configureActionButton(button, at: style)
switch style {
case .ok:
button.titleLabel?.font = UIFont.boldSystemFont(ofSize: 20)
button.setTitleColor(UIColor.gray, for: UIControlState())
case .cancel:
button.backgroundColor = UIColor.darkGray
button.setTitleColor(UIColor.white, for: UIControlState())
case .default:
button.setTitleColor(UIColor.lightGray, for: UIControlState())
default:
break
}
}
override func configureContentView(_ contentView: AlertContentView) {
super.configureContentView(contentView)
contentView.titleLabel.textColor = UIColor.lightGray
contentView.titleLabel.font = UIFont.boldSystemFont(ofSize: 30)
contentView.messageLabel.textColor = UIColor.lightGray
contentView.messageLabel.font = UIFont.boldSystemFont(ofSize: 16)
contentView.textBackgroundView.layer.cornerRadius = 10.0
contentView.textBackgroundView.clipsToBounds = true
}
}
Class
AlertAction
Style
- default
- ok
- cancel
- destructive
Initialize
init(title: String, style: SimpleAlert.AlertAction.Style, dismissesAlert: Bool = default, handler: ((SimpleAlert.AlertAction?) -> Swift.Void)? = default)
- Set title and style, can add button.
- Set button action handler.
Variable
var isEnabled: Bool
- Set button enabled.
let button: UIButton
- Can get a button.
- Can get after button has been added to the
AlertController
.
AlertContentView
backgroundColor
of AlertContentView
will be reflected in the overall backgroundColor
.
var baseView: UIView!
- Base view for contents
var titleLabel: UILabel!
- Title label
var messageLabel: UILabel!
- Message Label
var textBackgroundView: UIView!
- Base view for Text Field
UIAlertControllerStyle
is in the case ofactionSheet
does not appear.
AlertController
Initialize
init(title: String?, message: String?, style: UIAlertControllerStyle)
- Set title, message and style, can add button.
- Set button action handler.
init(title: String? = default, message: String? = default, view: UIView?, style: UIAlertControllerStyle)
- Can also set custom view.
Variable
open var contentWidth: CGFloat
open var contentColor: UIColor?
open var contentCornerRadius: CGFloat?
open var coverColor: UIColor
open var message: String?
- Can change alert style.
public private(set) var actions: [SimpleAlert.AlertAction]
public var textFields: [UITextField] { get }
- Can get actions and text fields that is added.
Function
func addTextField(configurationHandler: ((UITextField) -> Swift.Void)? = default)
- Add Text Field, and set handler.
UIAlertControllerStyle
is in the case ofactionSheet
does not add.
func addAction(_ action: SimpleAlert.AlertAction)
- Add action button.
func configureActionButton(_ button: UIButton, at style: SimpleAlert.AlertAction.Style)
- Override if would like to configure action button.
func configureContentView(_ contentView: SimpleAlert.AlertContentView)
- Override if would like to configure content view.
The difference between default UIAlertController
- Can add a cancel button any number of the
actionSheet
. - If tap the outside of the view, the action handler will not be executed of the
actionSheet
.
Author
Kyohei Ito
Follow me ๐
LICENSE
Under the MIT license. See LICENSE file for details.
*Note that all licence references and agreements mentioned in the SimpleAlert README section above
are relevant to that project's source code only.