Simple selection dialog
Clone or download
Latest commit 5865b43 Jul 27, 2018
Permalink
Failed to load latest commit information.
Images Change preview image Oct 18, 2015
Sample swift 4.1 Jul 27, 2018
SelectionDialog @objc added to work the code in Swift 4 based app Nov 27, 2017
.gitignore Add Sample Oct 8, 2015
.swift-version add .swift-version Jul 27, 2018
.travis.yml fix travis Jul 27, 2018
LICENSE Initial commit Oct 8, 2015
README.md Fix README.md Jul 27, 2018
SelectionDialog.podspec swift 4.1 Jul 27, 2018

README.md

SelectionDialog

Swift 3.0 Version License Platform Build Status

Simple selection dialog inspired from ios-custom-alertview

Preview

Preview Image

Requirements

  • iOS 8.0+
  • Swift 3
  • Xcode 8.0

Installation

CocoaPods

use_frameworks!
pod "SelectionDialog"

Manually

To install manually the KCSelectionDialog in an app, just drag the SelectionDialog/*.swift file into your project.

Usage

Swift

let dialog = SelectionDialog(title: "Dialog", closeButtonTitle: "Close")
dialog.addItem(item: "I have icon :)", icon: UIImage(named: "Icon1")!)
dialog.addItem(item: "I have icon and handler :D", icon: UIImage(named: "Icon2")!, didTapHandler: { () in
    print("Item didTap!")
})
dialog.addItem(item: "I have nothing :(")
dialog.show()

If you want to launch the dialog at the starting point of the app, make sure you put the code inside DispatchQueue.main.async. Otherwise it will not work

override func viewDidLoad() {
    DispatchQueue.main.async {
        let dialog = SelectionDialog(title: "Dialog", closeButtonTitle: "Close")
        dialog.addItem(item: "I have icon :)", icon: UIImage(named: "Icon1")!)
        dialog.addItem(item: "I have icon and handler :D", icon: UIImage(named: "Icon2")!, didTapHandler: { () in
            print("Item didTap!")
        })
        dialog.addItem(item: "I have nothing :(")
        dialog.show()
    }
}