All Projects → candostdagdeviren → Cdalertview

candostdagdeviren / Cdalertview

Licence: mit
Highly customizable alertview and alert/notification/success/error/alarm popup written in Swift

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Cdalertview

BalloonPopup
Forget Android Toast! BalloonPopup displays a round or squared popup and attaches it to a View, like a callout. Uses the Builder pattern for maximum ease. The popup can automatically hide and can persist when the value is updated.
Stars: ✭ 32 (-96.97%)
Mutual labels:  alerts, alert, popup-window, popup, alertview
Jalert
jQuery alert/modal/lightbox plugin
Stars: ✭ 73 (-93.09%)
Mutual labels:  alert, popup, popup-window, alerts
Sclalertview
Beautiful animated Alert View. Written in Objective-C
Stars: ✭ 3,426 (+224.43%)
Mutual labels:  cocoapods, carthage, alert, alertview
Kcustomalert
Simple and easy alerts to use instead of default AlertController. Separate Xib is provided to customize as pr your need. Callbacks are easily handled by using Closures.
Stars: ✭ 128 (-87.88%)
Mutual labels:  alert, popup, alertview
Overlaycontroller
OverlayController easily pop your custom view and provide optional transition animation. written in swift 5.0
Stars: ✭ 94 (-91.1%)
Mutual labels:  cocoapods, alert, popup-window
Customalertviewdialogue
Custom AlertView Dialogue is the world's most advanced alert view library. Custom AlertView Dialogue includes simple message popups, confirmation alerts, selector popups, action sheet bottom menus, and input/feedback contact forms.
Stars: ✭ 100 (-90.53%)
Mutual labels:  alert, popup, alertview
Lgalertview
Customizable implementation of UIAlertViewController, UIAlertView and UIActionSheet. All in one. You can customize every detail. Make AlertView of your dream! :)
Stars: ✭ 1,027 (-2.75%)
Mutual labels:  cocoapods, carthage, alertview
Mbpopup
macOS status bar popups done right 😎
Stars: ✭ 89 (-91.57%)
Mutual labels:  cocoapods, carthage, popup
Alertift
Swifty, modern UIAlertController wrapper.
Stars: ✭ 242 (-77.08%)
Mutual labels:  cocoapods, carthage, alert
Popupdialog
A simple, customizable popup dialog for iOS written in Swift. Replaces UIAlertController alert style.
Stars: ✭ 3,709 (+251.23%)
Mutual labels:  alert, popup, alertview
Jbox
jBox is a jQuery plugin that makes it easy to create customizable tooltips, modal windows, image galleries and more.
Stars: ✭ 1,251 (+18.47%)
Mutual labels:  alert, popup, popup-window
Cfnotify
A customizable framework to create draggable views
Stars: ✭ 490 (-53.6%)
Mutual labels:  carthage, alert, alertview
Harpy
Harpy checks a user's currently installed version of your iOS app against the version that is currently available in the App Store. If a new version is available, an alert can be presented to the user informing them of the newer version, and giving them the option to update the application.
Stars: ✭ 2,619 (+148.01%)
Mutual labels:  cocoapods, carthage, alert
Siren
Siren checks a user's currently installed version of your iOS app against the version that is currently available in the App Store.
Stars: ✭ 3,892 (+268.56%)
Mutual labels:  cocoapods, alert, alerts
Statusalert
Display Apple system-like self-hiding status alerts. It is well suited for notifying user without interrupting user flow in iOS-like way.
Stars: ✭ 809 (-23.39%)
Mutual labels:  cocoapods, carthage, alert
Swiftlyext
SwiftlyExt is a collection of useful extensions for Swift 3 standard classes and types 🚀
Stars: ✭ 31 (-97.06%)
Mutual labels:  cocoapods, carthage
Avsqldebugger
A Simple Core Data Debugger that will look inside your apps DB
Stars: ✭ 30 (-97.16%)
Mutual labels:  cocoapods, carthage
Bfkit Swift
BFKit-Swift is a collection of useful classes, structs and extensions to develop Apps faster.
Stars: ✭ 963 (-8.81%)
Mutual labels:  cocoapods, carthage
Lihalert
Advance animated alerts for iOS written in Swift
Stars: ✭ 34 (-96.78%)
Mutual labels:  alert, alertview
Ctpanoramaview
A library that displays spherical or cylindrical panoramas with touch or motion based controls.
Stars: ✭ 951 (-9.94%)
Mutual labels:  cocoapods, carthage

CDAlertView: Highly customizable alert popup

Carthage compatible Cocoapod CI Status Language Platform License

CDAlertView is highly customizable alert popup written in Swift. Usage is similar to UIAlertController.

Screenshots

CDAlertView Types

Animations

1 2 3

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.

canHideWhenTapBack -> Hide self when tapped backgroundView. Default is false.

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 the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].