Skip to content
main
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

JAlert

Version License Platform SPM compatible

Overview

JAlert is a simple, customizable Alert View written in Swift. We can choose the type we want and use it.

Preview

Type Properties

CocoaPods

JAlert is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'JAlert'

Swift Package Manager

The Swift Package Manager is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.

To integrate JAlert into your Xcode project using Swift Package Manager, add it to the dependencies value of your Package.swift:

dependencies: [
    .package(url: "https://github.com/JacksonJang/JAlert.git")
]

Usage

Quick Start

import JAlert

class ExampleViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        //We can choose Type1 or Type2
        //createType1()
        //createType2()
    }

    func createType1(){
        let alert = JAlert(
            title: "title", 
            message: "message", 
            buttons: ["OK","Cancel"], 
            onButtonClicked: { index in
                print("index : \(index)")
        })
        
        alert.show()
    }

    func createType2(){
        let alert = JAlert(
            title: "title", 
            message: "message", 
            alertType: .confirm
        )
        alert.setButton(
            actionName: "OK",
            cancelName: "Cancel"
        )
        alert.onButtonClicked = { index in
            print("index : \(index)")
        }
        alert.show()
    }
}

Contribution

Discussion and pull requests are welcomed !

License

JAlert is available under the MIT license. See the LICENSE file for more info.

About

JAlert is a simple, customizable Alert View written in Swift. We can choose the type we want and use it.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published