Go to file
Yonat Sharon 757ca7c7ea
Create FUNDING.yml
2022-07-31 06:38:53 +03:00
.github Create FUNDING.yml 2022-07-31 06:38:53 +03:00
Example allow spaces in path 2019-11-27 08:34:08 +02:00
Screenshots initial public release 2018-03-27 13:28:17 +03:00
Sources support two-finger pan gesture to select multiple items. 2019-10-09 21:33:40 +03:00
.gitignore add Package.swift, fix Interface Builder render error 2019-08-22 09:19:11 +03:00
CHANGELOG.md bump version to 1.4.0 2019-10-09 21:34:23 +03:00
LICENSE.txt initial public release 2018-03-27 13:28:17 +03:00
Package.swift add spm install instructions 2019-09-06 22:16:15 +03:00
README.md Update README.md 2021-04-17 01:16:19 +03:00
SelectionList.podspec bump version to 1.4.0 2019-10-09 21:34:23 +03:00

README.md

SelectionList

Simple single-selection or multiple-selection checklist, based on UITableView.

Swift Version Build Status License CocoaPods Compatible
Platform PRs Welcome

    

Usage

let selectionList = SelectionList()
selectionList.items = ["One", "Two", "Three", "Four", "Five"]
selectionList.addTarget(self, action: #selector(selectionChanged), for: .valueChanged)
selectionList.selectedIndex = 3

Multiple Selection

selectionList.allowsMultipleSelection = true
selectionList.selectedIndexes = [0, 1, 4]

Changing Appearance

The following properties can be changed either in Interface Builder or in code:

selectionList.selectionImage = UIImage(named: "v")
selectionList.deselectionImage = UIImage(named: "o")
selectionList.isSelectionMarkTrailing = false // to put checkmark on left side
selectionList.rowHeight = 42.0

You can do additional styling in code:

selectionList.setupCell =  { (cell: UITableViewCell, index: Int) in
    cell.textLabel?.textColor = .gray
}

If you want to remove the cells seperators

selectionList.tableView.separatorStyle = .none

Requirements

  • iOS 9.0+
  • Xcode 9+

Installation

CocoaPods:

pod 'SelectionList'

Legacy versions:

Swift version SelectionList version
4.1 (Xcode 9.4) pod 'SelectionList', '~> 1.2.0'
4.0 pod 'SelectionList', '~> 1.0.2'

Swift Package Manager:

dependencies: [
    .package(url: "https://github.com/yonat/SelectionList", from: "1.4.0")
]

Meta

@yonatsharon

https://github.com/yonat/SelectionList