Skip to content

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

License

Notifications You must be signed in to change notification settings

donggyushin/DGAlertView

Repository files navigation

DGAlertView

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

Requirements

  • iOS 12.0+
  • Swift 5.5+
  • Xcode 10.0+

Installation

SPM

File > Add Packages > https://github.com/donggyushin/DGAlertView

CocoaPod

pod 'DGAlertView', :git => 'https://github.com/donggyushin/DGAlertView'

Usage

func showAlert() {
    let view: UIView = {
        let view = UIView()
        view.backgroundColor = .white
        view.translatesAutoresizingMaskIntoConstraints = false

        // Make sure give view height anyway
        view.heightAnchor.constraint(equalToConstant: 200).isActive = true
        return view
    }()

    let vc = DGAlertView(view)

    // Make sure animated false
    present(vc, animated: false)
}

// Hide DGAlertView programmatically
let vc = DGAlertView(view)
vc.hide()
    

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published