SelectableStackView
SelectableStackView is a customizable and easy to use UI element for showing and managing selectable elements in a stack written in Swift.

Features
Requirements
- iOS 10.0+
- Xcode 11+
- Swift 5.2+
Swift Package Manager
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift
compiler.
Use Xcode’s new Swift Packages option, which is located within the File menu.
Usage example
ExampleApp
Add an arranged subview
import SelectableStackView
selectableStackView.addArrangedSubview(yourView) // make sure that your view conform to ObservableBySelectableStackView protocol
Select an view from code
import SelectableStackView
selectableStackView.select(true, at: someIndex) // if view at given index doesnt exist, nothing will happen
Receive selection events
import SelectableStackView
// 1. Conform to SelectableStackViewDelegate protocol
class SomeClass: SelectableStackViewDelegate {
let selectableStackView = SelectableStackView()
init() {
// 2. Set delegate
selectableStackView.delegate = self
}
// MARK: - SelectableStackViewDelegate
func didSelect(_ select: Bool, at index: Index, on selectableStackView: SelectableStackView) {
// handle selection
}
}
Advanced
Turn on logging
selectableStackView.loggingEnabled = on // enable logging if needed
Turn off delegate notifications on self selection
import SelectableStackView
class SomeClass: SelectableStackViewDelegate {
var shouldNotifyAboutSelfSelection: Bool { true }
}
License
SelectableStackView is released under the MIT license. See LICENSE for details.
SelectableStackView
SelectableStackView is a customizable and easy to use UI element for showing and managing selectable elements in a stack written in Swift.
Features
Requirements
Swift Package Manager
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the
swift
compiler.Use Xcode’s new Swift Packages option, which is located within the File menu.
Usage example
ExampleApp
Add an arranged subview
Select an view from code
Receive selection events
Advanced
Turn on logging
Turn off delegate notifications on self selection
License
SelectableStackView is released under the MIT license. See LICENSE for details.