SelectItemController is a single selectable dialog. It's easy to use, written in Swift.
Default Cell | Custom Cell |
---|---|
Default Cell | Custom Cell |
---|---|
- Swift 5.2
- iOS 9.0 or later
github "keygx/SelectItemController"
pod 'SelectItemController', :git => 'https://github.com/keygx/SelectItemController'
- Swift 5.2, tag "swift5.2"
- Swift 5.1, tag "swift5.1"
- Swift 5, tag "swift5"
- Swift 4.2, tag "swift4.2"
- Swift 4.1, tag "swift4.1"
- Swift 4.0, tag "swift4.0"
let items = ["First Item", "Second Item", "Third Item", "Fourth Item", "Fifth Item"]
let params = Parameters(title: "Select Item ...", items: items, cancelButton: "Cancel")
SelectItemController().show(parent: self, params: params) { (index) in
if let index = index {
print("selected: \(items[index])")
} else {
print("cancel")
}
}
let customTableView = CustomTableView() // User-created UITableView and custom cell
let params = Parameters(title: "Select Item ...", itemTableView: customTableView, cancelButton: "Cancel")
SelectItemController().show(parent: self, params: params) { (index) in
if let index = index {
print("selected: \(customTableView.items[index])")
} else {
print("cancel")
}
}
SelectItemController is released under the MIT license. See LICENSE for details.
Yukihiko Kagiyama (keygx) https://twitter.com/keygx