Skip to content

Simple single-selection or multiple-selection view, based on UITableView

License

Notifications You must be signed in to change notification settings

carabina/SelectionList

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SelectionList

Simple single-selection or multiple-selection view, 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
}

Requirements

  • iOS 9.0+
  • Xcode 9+

Installation

CocoaPods:

pod 'SelectionList'

Manually:

Copy Sources/SelectionList.swift to your Xcode project.

Meta

@yonatsharon

https://github.com/yonat/SelectionList

About

Simple single-selection or multiple-selection view, based on UITableView

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 91.7%
  • Ruby 8.3%