Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kciter/SelectionDialog
Simple selection dialog
https://github.com/kciter/SelectionDialog
Last synced: about 1 month ago
JSON representation
Simple selection dialog
- Host: GitHub
- URL: https://github.com/kciter/SelectionDialog
- Owner: kciter
- License: mit
- Created: 2015-10-08T17:37:53.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-10-30T04:49:11.000Z (about 5 years ago)
- Last Synced: 2024-05-22T07:22:22.849Z (8 months ago)
- Language: Swift
- Homepage:
- Size: 3.07 MB
- Stars: 117
- Watchers: 5
- Forks: 23
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - SelectionDialog - Simple selection dialog. (UI / Popup)
- awesome-swift - SelectionDialog - Simple selection dialog. (Libs / UI)
- awesome-swift - SelectionDialog - Simple selection dialog. (Libs / UI)
- awesome-ios-star - SelectionDialog - Simple selection dialog. (UI / Popup)
- fucking-awesome-swift - SelectionDialog - Simple selection dialog. (Libs / UI)
- awesome-swift - SelectionDialog - Simple selection dialog ` 📝 2 years ago ` (UI [🔝](#readme))
README
# SelectionDialog
![Swift 3.0](https://img.shields.io/badge/Swift-3.0-orange.svg)
[![Version](https://img.shields.io/cocoapods/v/SelectionDialog.svg?style=flat)](http://cocoapods.org/pods/selectiondialog)
[![License](https://img.shields.io/cocoapods/l/SelectionDialog.svg?style=flat)](http://cocoapods.org/pods/selectiondialog)
[![Platform](https://img.shields.io/cocoapods/p/SelectionDialog.svg?style=flat)](http://cocoapods.org/pods/selectiondialog)
[![Build Status](https://travis-ci.org/kciter/SelectionDialog.svg?branch=master)](https://travis-ci.org/kciter/SelectionDialog)Simple selection dialog inspired from [ios-custom-alertview](https://github.com/wimagguc/ios-custom-alertview)
# Preview
## Requirements
* iOS 8.0+
* Swift 3
* Xcode 8.0
## Installation
### CocoaPods
```ruby
use_frameworks!
pod "SelectionDialog"
```
### Manually
To install manually the KCSelectionDialog in an app, just drag the `SelectionDialog/*.swift` file into your project.## Usage
### Swift
```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
```swift
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()
}
}
```